private void DefaultSettings(string logicalName) { Columns = SolutionCheckerAvoider.CreateColumnSetWithAllColumns(); First = false; ActiveOnly = false; CriteriaOperator = LogicalOperator.And; LogicalName = logicalName; }
// These Extension Methods only makes sense for equality, since they set the values if not found... /// <summary> /// Retrieves the entity from CRM where the columnNameAndValuePairs match. If it doesn't exist, it creates it /// populating the entity with the columnNameAndValuePairs /// </summary> /// <typeparam name="T"></typeparam> /// <param name="service"></param> /// <param name="columnNameAndValuePairs">List of pairs that look like this: /// (string name of the column, value of the column) ie. "name","John Doe" goes to entity.name = "John Doe" /// </param> /// <returns></returns> public static T GetOrCreateEntity <T>(this IOrganizationService service, params object[] columnNameAndValuePairs) where T : Entity, new() { return(service.GetOrCreateEntity <T>(SolutionCheckerAvoider.CreateColumnSetWithAllColumns(), columnNameAndValuePairs)); }
/// <summary> /// Retrieves the Entity of the given type with the given Id, with all columns /// </summary> /// <typeparam name="T">An early bound Entity Type</typeparam> /// <param name="service">open IOrganizationService</param> /// <param name="id">Primary Key of Entity</param> /// <returns></returns> public static T GetEntity <T>(this IOrganizationService service, Guid id) where T : Entity { return(service.GetEntity <T>(id, SolutionCheckerAvoider.CreateColumnSetWithAllColumns())); }
public void IlSpecifyColumn_CreatesColumnSetWithAllColumnsTrue() { var sut = SolutionCheckerAvoider.CreateColumnSetWithAllColumns(); Assert.IsTrue(sut.AllColumns, "All columns should have been set to true."); }