Пример #1
0
        public T ObterPorContato(Guid contatoId, Domain.Enum.StateCode status)
        {
            var query = GetQueryExpression <T>(true);

            #region Condições

            #region Status
            query.Criteria.Conditions.Add(new ConditionExpression("statecode", ConditionOperator.Equal, (int)status));
            #endregion

            ConditionExpression cond1 = new Microsoft.Xrm.Sdk.Query.ConditionExpression("itbc_contatoid", ConditionOperator.Equal, contatoId);
            query.Criteria.Conditions.Add(cond1);
            #endregion

            var colecao = this.RetrieveMultiple(query);

            if (colecao.List.Count == 0)
            {
                return(default(T));
            }

            return(colecao.List[0]);
        }
Пример #2
0
 public AcessoKonviva ObterPorContato(Guid contato, Domain.Enum.StateCode status)
 {
     return(RepositoryService.AcessoKonviva.ObterPorContato(contato, status));
 }