/// <summary> /// The Save /// </summary> /// <param name="entity">The entity<see cref="Licence"/></param> /// <returns>The <see cref="ServiceResult"/></returns> public ServiceResult Save(Licence entity) { try { if (entity.Identifier == 0) { _repository.Add(entity); } else { _repository.Update(entity); } return(new ServiceResult(true)); } catch (Exception ex) { return(new ServiceResult(false) { Error = ex.ToString() }); } }
public void CreateLicence(LicencePivot licence) { GES_Licence item = Mapper.Map <LicencePivot, GES_Licence>(licence); licenceRepository.Add(item); }
public Licence Add(Licence newLicence) { return(_licenceRepository.Add(newLicence)); }