async public Task Insert(POSInvoice entity) { string record = toJson(entity); ServiceLayerResponse response = await _serviceLayerConnector.Post(SL_TABLE_NAME, record, false, true); if (!response.success) { string message = $"Erro ao enviar transação de '{entity.EntityName}': {response.errorCode}-{response.errorMessage}"; Console.WriteLine(message); throw new ApplicationException(message); } }
async public Task <POSInvoice> Find(List <Criteria> criterias) { POSInvoice result = null; List <POSInvoice> lista = await this.List(criterias); if (lista != null && lista.Count != 0) { result = lista[0]; } ; return(result); }
async Task <POSInvoice> IEntityServiceWithReturn <POSInvoice> .Insert(POSInvoice entity) { POSInvoice result = null; string record = toJson(entity); ServiceLayerResponse response = await _serviceLayerConnector.Post(SL_TABLE_NAME, record, false, true); if (!response.success) { string message = $"Erro ao enviar transação de '{entity.EntityName}': {response.errorCode}-{response.errorMessage}"; Console.WriteLine(message); throw new ApplicationException(message); } else { ExpandoObject responseData = Global.parseQueryToObject(response.data); result = toRecord(responseData); } return(result); }
public Task Delete(POSInvoice entity) { throw new NotImplementedException(); }