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
class MainPageViewModel | |
{ | |
// a place on page | |
public string Categories { get; set; } | |
// other place on the page | |
public List<Products> Products { get; set; } | |
} | |
// Controller: | |
public class HomeController : Controller |
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
// | |
// Convert a object to byte array | |
// | |
ObjectType _theObject; // Populates from somewhere | |
BinaryFormatter formatter = new BinaryFormatter(); | |
MemoryStream ms = new MemoryStream(); | |
formatter.Serialize(ms, _theObject); | |
byte[] bytes = ms.ToArray(); | |
FileStream fs = new FileStream("dummy.bin", FileMode.Create); | |
fs.Write(bytes, 0, bytes.Length); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using Autofac; | |
namespace Throwit.Business.SomeObjects | |
{ |
OlderNewer