Пример #1
0
 public ServiceResult <string> Delete(int Id)
 {
     try
     {
         IMediator service = _container.GetInstance <IMediator>();
         var       query   = new LogDatabaseDeleteQuery {
             Id = Id
         };
         return(new ServiceResult <string>(service.Proccess(query).ToString(), message: ClientErrorMessage.Success(), state: ServiceResultStates.SUCCESS));
     }
     catch (ExceptionLog ex)
     {
         LoggerService.Logger.Log(_container, ex);
         return(new ServiceResult <string>(result: null, message: ClientErrorMessage.Error(), state: ServiceResultStates.ERROR));
     }
 }
Пример #2
0
 	public ServiceResult<string> Delete(int Id)
 	{
 		try
 		{
 			IMediator service = _container.GetInstance<IMediator>();
 			var query = new LogDatabaseDeleteQuery{ Id = Id };
 			return new ServiceResult<string>(service.Proccess(query).ToString(), message: ClientErrorMessage.Success(), state: ServiceResultStates.SUCCESS);
 		}
 		catch(ExceptionLog ex)
 		{
 			LoggerService.Logger.Log(_container, ex);
 			return new ServiceResult<string>(result: null, message: ClientErrorMessage.Error(), state: ServiceResultStates.ERROR);
 		}
 	}