/// <summary> /// Create a new ServiceCategory object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="title">Initial value of the Title property.</param> public static ServiceCategory CreateServiceCategory(global::System.Int32 id, global::System.String title) { ServiceCategory serviceCategory = new ServiceCategory(); serviceCategory.Id = id; serviceCategory.Title = title; return serviceCategory; }
public static Service[] GetServicesByCategory(ServiceCategory selectedCategory) { EntityModelContainer context = GetContext(); return context.Services.Execute(MergeOption.OverwriteChanges) .Where(s => s.ServiceCategoryRelations.Any (sc => (sc.ServiceCategoryId == selectedCategory.Id) || (selectedCategory.Id == 0))).ToArray(); }
/// <summary> /// Deprecated Method for adding a new object to the ServiceCategories EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToServiceCategories(ServiceCategory serviceCategory) { base.AddObject("ServiceCategories", serviceCategory); }