Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business Layer Generator and Computed DateTime Fields
Message
De
18/02/2011 09:27:59
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
18/02/2011 09:04:44
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01500696
Message ID:
01500699
Vues:
35
>Hi,
>
>MM.NET 3.6
>
>I have two computed datetime fields on table in my SQL Server database. When I run the Business Layer Generator, this code gets generated in the BO.cs:
>
>
		protected override void HookSetDefaultValues(PolicyHeaderEntity entity)
>		{
>			if (this.DefaultValues != null)
>			{
>				// Store the dynamic default values via the entity object
>				entity.DatePaidTo = Defaults.DatePaidTo;
>				entity.PremiumDue = Defaults.PremiumDue;
>			}
>
>But these fields are set to accept null values and I also cleared out the defaults for these fields in the generator. Of course this code causes an error:
>
>"Property or indexer 'SamaanSystems.IAS.Business.PolicyHeaderEntity.DatePaidTo' cannot be assigned to -- it is read only"
>
>For now I am just deleting the code, but is this a bug in the generator or is there something else I need to do?

Frank, It is fine to just remove these two lines if you don't need them. My guess is the generator didn't have logic to determine the type of fields they were in the Database. I would have thought you could have set them to not Required in the BLG though if they were set to accept nulls.
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform