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); }
public Guid Create <T>(T record) { Entity ent = CustomEntityModelMapper.ToEntity <T>(record); return(_organizationService.Create(ent)); }