public void Update(DalRole entity) { Role role = context.Set<Role>().FirstOrDefault(r => r.Id == entity.Id); if (role != null) { role.Name = entity.Name; role.Description = entity.Description; } }
public void Create(DalRole entity) { Role role = new Role() { Name = entity.Name.ToLower(), Description = entity.Description }; context.Set<Role>().Add(role); }