This file contains hidden or 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
namespace MvcApplication.Database | |
{ | |
public class MyAppContext : DbContext | |
{ | |
public DbSet<CordBloodUnit> CordBloodUnits { get; set; } | |
} | |
} |
This file contains hidden or 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
namespace MvcApplication1.Models | |
{ | |
public class CordBloodUnit | |
{ | |
public int ID { get; set; } | |
public int HLA_A1 { get; set; } | |
public int HLA_A2 { get; set; } | |
public int HLA_B1 { get; set; } | |
public int HLA_B2 { get; set; } |
This file contains hidden or 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
[Authorize(Roles="ACustomRole")] | |
public class SomeController : Controller | |
{ | |
} |
This file contains hidden or 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
void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs e) | |
{ | |
// Instantiate a user repository so as to get User information | |
IRepository<User> userRepository = new Repository<User>(); | |
if (e.Identity != null && e.Identity.IsAuthenticated) | |
{ | |
WindowsIdentity wi = e.Identity; | |
User user = userRepository.GetBy(u => u.Name == wi.Name).FirstOrDefault(); | |
user.Identity = wi; | |
HttpContext.Current.User = user; |
This file contains hidden or 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 User : IPrincipal | |
{ | |
public string Name { get; set; } | |
public string EMail { get; set; } | |
public string Phone1 { get; set; } | |
public string Phone2 { get; set; } | |
public virtual IEnumerable<Permission> Permissions { get; set; } | |
public User() |
This file contains hidden or 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 User | |
{ | |
public string Name { get; set; } | |
public string EMail { get; set; } | |
public string Phone1 { get; set; } | |
public string Phone2 { get; set; } | |
public virtual IEnumerable<Permission> Permissions { get; set; } | |
public User() |
This file contains hidden or 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
namespace IEnumerable.Tests | |
{ | |
[TestClass] | |
public class TestAggregate | |
{ | |
Func<int, int, int> sum = (a, b) => a + b; | |
[TestMethod] | |
public void ShouldAggregateAllElementsInASequence() | |
{ | |
var sequence = Enumerable.Range(1, 2); |
This file contains hidden or 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
// resembles a IEnumerator. has Current and MoveNext | |
public class Duckerator | |
{ | |
public bool MoveNext() | |
{ | |
return false; | |
} | |
public Object Current { get; private set; } | |
} |
NewerOlder