12/25/2023 0 Comments Relogio iclockSaving data to and reading data from database via Entity Framework Core.DateTime type binding in the ASP.NET Core MVC model binding.Normalize method is used by the ABP Framework when the it gets a DateTime that is not created by IClock.Now and may not be compatible with the current Clock type. Sets Kind of the given DateTime (using the DateTime.SpecifyKind(.) method) to the Kind of the current Clock if given DateTime's Kind is Unspecified.Converts the given DateTime to the local (by using the DateTime.ToLocalTime() method) if current Clock is local and given DateTime is UTC.Converts the given DateTime to the UTC (by using the DateTime.ToUniversalTime() method) if current Clock is UTC and given DateTime is local.Normalize method works as described below: Var normalizedDateTime = Clock.Normalize(dateTime) Other important function of the IClock is to normalize DateTime objects.Įxample usage: DateTime dateTime =. Either make it Utc or Local if you want to get benefit of the Clock system. Write this inside the ConfigureServices method of your module.ĭefault Kind is Unspecified, that actually make the Clock as it doesn't exists at all. Clock OptionsĪbpClockOptions is the options class that used to set the clock kind.Įxample: Use UTC Clock Configure(options => Most of the times, IClock is the only service you need to know and use in your application. Use the Now property to get the current time.Common base classes (like ApplicationService) already injects it and provides as a base property - so, you can directly use as Clock. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |