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 BitmapImageValueConverter : MvxValueConverter<byte[], BitmapImage> | |
{ | |
protected override BitmapImage Convert(byte[] value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
var bitmapImage = new BitmapImage(); | |
try | |
{ | |
if (value != null) | |
{ | |
var ms = new MemoryStream(value); |
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 ActionResult Index() | |
{ | |
var repo = new Repository(); | |
var dto = repo.GetDtoById(1); // Note, this doesn't know about the cache at all | |
} | |
public class Repository() | |
{ | |
[Cache(Duration = 10)] | |
public DTO GetDtoById(int id) |