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
var orderHeaders = Session.CreateQuery( | |
@"select new OrderHeader(o.OrderedOn, c.Name, e.FirstName || ' ' || e.LastName) | |
from Order o inner join o.Customer c inner join o.Employee e") | |
.List<OrderHeader>(); |
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 SetTempDataWhenModelStateInvalidAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuted(ActionExecutedContext filterContext) | |
{ | |
base.OnActionExecuted(filterContext); | |
if (!filterContext.Controller.ViewData.ModelState.IsValid) | |
{ | |
filterContext.Controller.TempData["ModelState"] = filterContext.Controller.ViewData.ModelState; | |
} | |
} |
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
function delayAuthenticationResponse(session, callback) { | |
if (!session.attempts) { | |
session.attempts = 1; | |
} else { | |
session.attempts++; | |
} | |
setTimeout(callback, session.attempts * 1000); | |
} |
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 Address | |
{ | |
public Address(string street, string city, string region, | |
string postalCode, string country, string phoneNumber) | |
{ | |
_street = StringValueOrEmptyString(street); | |
_city = StringValueOrEmptyString(city); | |
_region = StringValueOrEmptyString(region); | |
_postalCode = StringValueOrEmptyString(postalCode); | |
_country = StringValueOrEmptyString(country); |
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 SqlMetaDataProvider : IMetaDataProvider | |
{ | |
private readonly string _connectionString; | |
private readonly SqlDataRetriever _sqlDataRetriever; | |
public SqlMetaDataProvider(string connectionString) | |
{ | |
_connectionString = connectionString; | |
_sqlDataRetriever = new SqlDataRetriever(); | |
} |
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
<id name="Id" column="CustomerId" type="long" unsaved-value="-1" access="field.camelcase-underscore"> | |
<generator class="native" > | |
<param name="sequence">sq_customer</param> | |
</generator> | |
</id> |
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 name="Foo" table="foo_table" mutable="false"> |
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
[ServiceContract] | |
public interface ICustomerService | |
{ | |
[UseNetDataContractSerializer] | |
[OperationContract] | |
IList<Customer> GetCustomersWithTheirOrders(); | |
[UseNetDataContractSerializer] | |
[OperationContract] | |
void PersistCustomer(Customer customer); |
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
BOOL WINAPI XcvData(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData, | |
PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded, PDWORD pdwStatus); |
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 Member | |
{ | |
private readonly List<Member> _parents; | |
private readonly List<Member> _children; | |
public Member() | |
{ | |
_parents = new List<Member>(); | |
_children = new List<Member>(); | |
} |
OlderNewer