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
.