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 InMemoryDataContext : IDataContext | |
| { | |
| static int lastId; | |
| readonly IList<object> entities; | |
| public InMemoryDataContext(params object[] preexistingEntities) | |
| { | |
| entities = preexistingEntities.ToList(); | |
| SaveChanges(); | |
| } |
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
| // GET: /Projects/Show/13 | |
| public ActionResult Show(int id) | |
| { | |
| var project = DataContext.Set<Project>() | |
| .Include("Steps") | |
| .Include("Steps.Destinations") | |
| .Include("Releases") | |
| .Include("Releases.Deployments") | |
| .Where(p => p.Id == id) | |
| .FirstOrDefault(); |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.Composition; | |
| using System.ComponentModel.Composition.Hosting; | |
| using System.Linq; | |
| using System.Text; | |
| namespace MefDemo | |
| { | |
| class Program |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Runtime.InteropServices; | |
| namespace TaskOverlapped | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using NUnit.Framework; | |
| namespace Auth | |
| { | |
| [TestFixture] | |
| public class RuleSetFixture | |
| { |
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 Group | |
| { | |
| public Group() | |
| { | |
| Users = new List<string>(); | |
| ChildGroups = new List<string>(); | |
| } | |
| public string Id { get; set; } | |
| public string Name { 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
| public class UsersInGroups : AbstractMultiMapIndexCreationTask<UsersInGroups.Result> | |
| { | |
| public UsersInGroups() | |
| { | |
| AddMap<Group>(groups => from g in groups | |
| from user in g.Users | |
| select new Result { UserId = user, GroupId = g.Id, Parents = new string[0] }); | |
| AddMap<GroupTree>(tree => from t in tree | |
| from g in t.Lineages |
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 void Validate(HttpRequestBase request) | |
| { | |
| var providedHash = request.Form["security_request_hash"]; | |
| if (string.IsNullOrWhiteSpace(providedHash)) | |
| throw new HttpRequestValidationException("Expected a value for 'security_request_hash'."); | |
| var pairs = | |
| from key in request.Form.AllKeys | |
| let value = request.Form[key] | |
| where key != "security_request_hash" |
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
| @model EditUserModel | |
| @using (Html.BeginForm()) | |
| { | |
| <div> | |
| @Html.HiddenFor(m => m.Id) | |
| @Html.TextBoxFor(m => m.FirstName) | |
| @Html.TextBoxFor(m => m.LastName) | |
| @Html.DropDownListFor(m => m.CountryId, Model.Countries.Select(c => new SelectListItem { Value = c.Id, Text = c.Name }) | |
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
| @model EditUserModel | |
| @using (Html.BeginForm()) | |
| { | |
| <div> | |
| @Html.HiddenFor(m => m.Id) | |
| @Html.TextBoxFor(m => m.FirstName) | |
| @Html.TextBoxFor(m => m.LastName) | |
| @Html.DropDownListFor(m => m.CountryId, Model.Countries) | |