public int Create(UserScoreForDescriptor userScoreForDescriptorToCreate) { if (userScoreForDescriptorToCreate == null) { throw new Exception("The User Score For Descriptor To Create sent in for creation is null."); } base.UpdateDateAdded(userScoreForDescriptorToCreate); base.UpdateIsDeletedToFalse(userScoreForDescriptorToCreate); db.UserScoreForDescriptors.Add(userScoreForDescriptorToCreate); db.SaveChanges(); int idOfUserScoreForDescriptor = userScoreForDescriptorToCreate.ID; return idOfUserScoreForDescriptor; }
public void Delete(UserScoreForDescriptor userScoreForDescriptorToDelete) { Delete(userScoreForDescriptorToDelete.ID); }
public int Update(UserScoreForDescriptor updatedUserScoreForDescriptor) { UserScoreForDescriptor userScoreForDescriptorToUpdate = db.UserScoreForDescriptors.SingleOrDefault(i => i.ID == updatedUserScoreForDescriptor.ID && i.IsDeleted == false); if (userScoreForDescriptorToUpdate == null) { throw new Exception("No Like exists with the id " + updatedUserScoreForDescriptor.ID); } base.UpdateDateUpdated(userScoreForDescriptorToUpdate); db.UserScoreForDescriptors.AddOrUpdate(u => u.ID, updatedUserScoreForDescriptor); db.SaveChanges(); int idOfUserScoreForDescriptor = userScoreForDescriptorToUpdate.ID; return idOfUserScoreForDescriptor; }
public void Destroy(UserScoreForDescriptor userScoreForDescriptorToDestroy) { Destroy(userScoreForDescriptorToDestroy.ID); }