public string Update(Feature entity) { var originalEntity = this.Context.Features.Find(entity.Id); this.Context.Entry(originalEntity).CurrentValues.SetValues(entity); this.Context.Entry(originalEntity).State = EntityState.Modified; this.Commit(); return entity.Id.ToString(); }
public FeatureViewModel(Feature x) { this.Id = x.Id; this.Name = x.Name; this.ParentId = x.ParentId; this.Class = x.Class; this.Href = x.Href; if (x.Features != null) { this.Features = x.Features.Select(f => new FeatureViewModel(f)).ToList(); } }
public string Insert(Feature entity) { this.Context.Features.Add(entity); this.Commit(); return entity.Id.ToString(); }
public string Update(Feature entity) { return this.repository.Update(entity); }
public string Insert(Feature entity) { return this.repository.Insert(entity); }