SharpArch.Core.PreconditionException: For better clarity and reliability, Entities with an assigned

Posted by Quintin Par on Stack Overflow See other posts from Stack Overflow or by Quintin Par
Published on 2010-03-26T04:37:15Z Indexed on 2010/03/26 4:43 UTC
Read the original article Hit count: 283

Filed under:
|
|
|

When I do a save of an entity with assigned id I get a

SharpArch.Core.PreconditionException: For better clarity and reliability, Entities with an assigned Id must call Save or Update

My class is

public class CompanyUserRepository :
RepositoryWithTypedId<CompanyUser, string>, ICompanyUserRepository
{
   public override CompanyUser SaveOrUpdate(CompanyUser entity)
   {
     var user = base.SaveOrUpdate(entity);
     //Do some stuff
     return user;
   }
}

How do I go about saving this entity?

RepositoryWithTypedId does not expose a Save method

Related question. This tells you the reason, but I haven't found out the Sharp Architecture way to do a Save.

© Stack Overflow or respective owner

Related posts about s#arp-architecture

    Related posts about nhibernate