Sms MaterializeSmsFromDto(SmsDTO smsDTO) { var current = SmsFactory.CreateSms(smsDTO.Code, smsDTO.Mobile, smsDTO.Type, smsDTO.IP, smsDTO.ValidateState); current.ChangeCurrentIdentity(smsDTO.Id); return(current); }
/// <summary> /// news a account /// </summary> /// <param name="praiseDTO"></param> /// <returns></returns> public SmsDTO AddNewSms(SmsDTO smsDTO) { //check preconditions if (smsDTO == null) { throw new ArgumentException(Messages.warning_CannotAddSmsWithEmptyInformation); } //Create the entity and the required associated data var sms = SmsFactory.CreateSms(smsDTO.Code, smsDTO.Mobile, smsDTO.Type, smsDTO.IP, smsDTO.ValidateState); //save entity SaveSms(sms); //return the data with id and assigned default values return(sms.ProjectedAs <SmsDTO>()); }