I am going to store a comma delimited list of courseIDs available with a product, there could be any number of them and many times only ONE. I am using MVC and I want to be able to extract out the list into a collection of some sort prior to it being in the model. Basically I don't want to parse a list into an array inside of the view or controller... How/where is the best way to do this, here is my product object that is used by my repository. What would I use for the type of the courseIDs collection and where do I convert it from a comma delimited list in the database into an array or something?
namespace DomainModel.Entities
{
public class Product
{
public int ProductID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public decimal Price { get; set; }
public ??? CourseIDs { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DomainModel.Entities;
namespace DomainModel.Abstract
{
public interface IProductsRepository
{
IQueryable<Product> Products { get; }
}
}