public ServiceResult<CommonUserType> Add(CommonUserType obj)
 	{
 		try
 		{
 			IMediator service = _container.GetInstance<IMediator>();
 			IUserContext currentUser = _container.GetInstance<IUserContext>();
 			obj.IsDeleted = false;
 			var query = new CommonUserTypeAddQuery();
 			query.CommonUserType = obj;
 			return new ServiceResult<CommonUserType>(service.Proccess(query), message: ClientErrorMessage.Success(), state: ServiceResultStates.SUCCESS);
 		}
 		catch(ExceptionLog ex)
 		{
 			LoggerService.Logger.Log(_container, ex);
 			return new ServiceResult<CommonUserType>(result: null, message: ClientErrorMessage.Error(), state: ServiceResultStates.ERROR);
 		}
 	}
Exemplo n.º 2
0
 public ServiceResult <CommonUserType> Add(CommonUserType obj)
 {
     try
     {
         IMediator    service     = _container.GetInstance <IMediator>();
         IUserContext currentUser = _container.GetInstance <IUserContext>();
         obj.IsDeleted = false;
         var query = new CommonUserTypeAddQuery();
         query.CommonUserType = obj;
         return(new ServiceResult <CommonUserType>(service.Proccess(query), message: ClientErrorMessage.Success(), state: ServiceResultStates.SUCCESS));
     }
     catch (ExceptionLog ex)
     {
         LoggerService.Logger.Log(_container, ex);
         return(new ServiceResult <CommonUserType>(result: null, message: ClientErrorMessage.Error(), state: ServiceResultStates.ERROR));
     }
 }