Ejemplo n.º 1
0
        public async Task Upsert(CrmExecuteEntity entity, Guid?proxyUserId = null)
        {
            CrmUpsertRequestMessage request = new CrmUpsertRequestMessage()
            {
                Entity      = entity,
                ProxyUserId = proxyUserId,
            };

            await Execute(request);
        }
Ejemplo n.º 2
0
        public async Task UpsertAlternate(CrmExecuteEntity entity, Dictionary <string, object> alternateKeys, Guid?proxyUserId = null)
        {
            CrmUpsertRequestMessage request = new CrmUpsertRequestMessage()
            {
                Entity        = entity,
                AlternateKeys = alternateKeys,
                ProxyUserId   = proxyUserId,
            };

            await Execute(request);
        }
Ejemplo n.º 3
0
        public async Task <Guid> Create(CrmExecuteEntity entity, Guid?proxyUserId = null)
        {
            CrmCreateRequestMessage request = new CrmCreateRequestMessage()
            {
                Entity      = entity,
                ProxyUserId = proxyUserId
            };

            var response = await Execute(request);

            return(((CrmCreateResponseMessage)response).Id);
        }
Ejemplo n.º 4
0
        public async Task <CrmEntity> Upsert(CrmExecuteEntity entity, Guid?proxyUserId = null, Dictionary <string, IEnumerable <string> > headers = null, params string[] attributes)
        {
            CrmUpsertRetrieveRequestMessage request = new CrmUpsertRetrieveRequestMessage()
            {
                Entity      = entity,
                ProxyUserId = proxyUserId,
                Attributes  = attributes
            };

            if (headers != null)
            {
                foreach (var item in headers)
                {
                    request.Headers.Add(item.Key, item.Value);
                }
            }

            var response = await Execute(request);

            return(((CrmUpsertRetrieveResponseMessage)response).Entity);
        }