65
1
using System;
2
using System.Collections.Generic;
3
4
public interface IViewEngine
5
{
6
string Render(string viewName, Dictionary<string, object> context);
7
}
8
9
public class MatchaViewEngine: IViewEngine
10
{
11
public string Render(string viewName, Dictionary<string, object> context)
12
{
13
return "View Rendered by Matcha";
14
}
15
}
16
17
public class SharpViewEngine: IViewEngine
18
{
19
public string Render(string viewName, Dictionary<string, object> context)
20
{
21
return "View Rendered by Sharp";
22
}
23
}
24
Cached Result
Example 1
System.Int32[]
Example 2
Unhandled exception. System.FieldAccessException: Attempt by method 'GetUnderlyingArrayClass.GetUnderlyingArray(System.Collections.Generic.List`1<Int32>)' to access field 'System.Collections.Generic.List`1<System.Int32>._items' failed.
at GetUnderlyingArrayClass.GetUnderlyingArray(List`1)
at Program.Main()
Command terminated by signal 6
System.Int32[]
Example 2
Unhandled exception. System.FieldAccessException: Attempt by method 'GetUnderlyingArrayClass.GetUnderlyingArray(System.Collections.Generic.List`1<Int32>)' to access field 'System.Collections.Generic.List`1<System.Int32>._items' failed.
at GetUnderlyingArrayClass.GetUnderlyingArray(List`1)
at Program.Main()
Command terminated by signal 6