예제 #1
0
        private async Task <Tuple <IEnumerable <CrmTypeSimpleModel>, string> > GetAllCrmTypes()
        {
            try
            {
                var crmTypees = await _crmTypeService.GetAll();

                if (crmTypees.IsSuccess)
                {
                    return(new Tuple <IEnumerable <CrmTypeSimpleModel>, string>(crmTypees.Data,
                                                                                string.Empty));
                }

                Logger.LogInformation(crmTypees.Message);
                return(new Tuple <IEnumerable <CrmTypeSimpleModel>, string>(new List <CrmTypeSimpleModel>(),
                                                                            crmTypees.Message));
            }
            catch (Exception exception)
            {
                Logger.LogInformation(exception.ToString());
                return(new Tuple <IEnumerable <CrmTypeSimpleModel>, string>(new List <CrmTypeSimpleModel>(),
                                                                            exception.ToString()));
            }
        }
예제 #2
0
 public async Task <ActionResult <IEnumerable <CrmTypeModel> > > GetAll()
 {
     return(Ok(await _crmTypeService.GetAll(await GetUserId(),
                                            GetPermissionId())));
 }