-
Notifications
You must be signed in to change notification settings - Fork 2
How to find, save and delete entities
marektihkan edited this page Sep 13, 2010
·
4 revisions
- Import
Arc.Infrastructure.Data
namespace for Active Record extensions.
- Entity must implement
Arc.Domain.Identity.ISaveable
(marker interface) for Save extension. - Entity must implement
Arc.Domain.Identity.IDeletable
(marker interface) for Delete extension. -
ServiceLocator must be configured for type
Arc.Infrastructure.Data.IRepository<TEnity>
.
var person = Find<Person>.ByIdentity(1);
var person = Find<Person>.By(x => x.Name == "John Smith");
var persons = Find<Person>.All();
var persons = Find<Person>.AllBy(x => x.Name.StartsWith("John"));
person.Save();
person.Delete();