Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace app.ORM.Models
- {
- class Product
- {
- public decimal ProductID { get; private set; }
- public string Title { get; set; }
- public string Description { get; set; }
- public DateTime Added { get; set; }
- public bool AllowPublic { get; set; }
- public Institution Institution { get; set; }
- public Product(string title, string description, bool allowPublic, Institution institution) : this(-1, title, description, new DateTime(), allowPublic, institution) {
- }
- public Product(string title, string description, DateTime added, bool allowPublic, Institution institution) : this(-1, title, description, added, allowPublic, institution)
- {
- }
- public Product(decimal productID, string title, string description, DateTime added, bool allowPublic, Institution institution) {
- this.ProductID = productID;
- this.Title = title;
- this.Description = description;
- this.Added = added;
- this.AllowPublic = allowPublic;
- this.Institution = institution;
- }
- private string ToString(bool debug = false)
- {
- if (debug)
- {
- return string.Format("ProductID: {0} [{1}]", ProductID, Title);
- }
- else
- {
- return string.Format("{0}", Title);
- }
- }
- public override string ToString()
- {
- return this.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement