コード例 #1
0
        public IEnumerable <T> ExecuteSync <T>(string fetchXml)
        {
            var query = new FetchExpression(fetchXml);
            EntityCollection entityCollection = _organizationService.RetrieveMultiple(query);

            if (typeof(T) == typeof(Entity))
            {
                return((IEnumerable <T>)entityCollection.Entities.AsEnumerable());
            }

            var result = CustomEntityModelMapper.ToModel <T>(entityCollection.Entities.ToList());

            return(result);
        }
コード例 #2
0
        public Guid Create <T>(T record)
        {
            Entity ent = CustomEntityModelMapper.ToEntity <T>(record);

            return(_organizationService.Create(ent));
        }