Last active
May 12, 2016 02:59
-
-
Save jsgao0/bd1b6b4ac12e06d36f570c6cfdb11dd1 to your computer and use it in GitHub Desktop.
Group by some property in a class constructor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BusinessHours { | |
public DateTime openAt { get; private set; } | |
public DateTime closeAt { get; private set; } | |
public BusinessHours(DateTime openAt, DateTime closeAt) { | |
this.openAt = openAt; | |
this.closeAt = closeAt; | |
} | |
} | |
public class GroceryStore<T> where T : Grocery { | |
public String storeName { get; set; } | |
public String storeLocation { get; set; } | |
public BusinessHours storeBusinessHours { get; set; } | |
// TODO: Contructor. | |
} | |
public abstract class Grocery { | |
public String itemName { get; set; } | |
public float itemPrice { get; set; } | |
public DateTime itemExpiryDate { get; set; } | |
} | |
public class Food : Grocery {} | |
public class DailyUse : Grocery {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment