Why can't I use this interface to create a strongly typed view?
public interface IAmAnAsset
{
int assetID { get; }
String assetTag { get; set; }
int? AddedBy { get; set; }
DateTime addedDate { get; set; }
int? LocationId { get; set; }
DateTime? purchasedDate { get; set; }
int? purchasedby { get; set; }
DateTime? disposalDate { get; set; }
int assetModelId { get; set; }
int? employeeId { get; set; }
float? depreciated { get; set; }
IAmAComputer Computer { get; }
}
When I take that exact item and convert to an abstract class, it lets me create a strongly typed view.
I'm new but I would imagine there's something I'm missing, ASP.NET MVC can work with interfaces, right?
Here's the specific class in the persistence layer I'm trying to make use of to create a strongly typed view.
public class ModelAsset : BufferedLinqEntity2<LqGpsDataContext, asset>, AssetManagementModel.IAmAnAsset
{
...
}
I'm trying to create my first MVC view.
Best Answer
ASP.NET works perfectly fine with interfaces: