¡@

Home 

c# Programming Glossary: ctx

URL mapping with C# HttpListener

http://stackoverflow.com/questions/10017564/url-mapping-with-c-sharp-httplistener

8080 listener.Start while isRunning HttpListenerContext ctx listener.GetContext new Thread new Worker ctx .ProcessRequest.. ctx listener.GetContext new Thread new Worker ctx .ProcessRequest .Start Is it possible to map specific URL patterns.. http 8080 listener.Start while true HttpListenerContext ctx listener.GetContext ThreadPool.QueueUserWorkItem _ string methodName..

Issue using ASP.Net MVC 4 Web API with Ninject.Web.WebApi

http://stackoverflow.com/questions/11207766/issue-using-asp-net-mvc-4-web-api-with-ninject-web-webapi

new StandardKernel kernel.Bind Func IKernel .ToMethod ctx new Bootstrapper .Kernel kernel.Bind IHttpModule .To HttpApplicationInitializationHttpModule..

Polymorphism: Is ORM entity a Domain Entity or Data Entity?

http://stackoverflow.com/questions/11257484/polymorphism-is-orm-entity-a-domain-entity-or-data-entity

public Account GetById Guid id using AccountContext ctx new AccountContext var data from a in ctx.Accounts where.. AccountContext ctx new AccountContext var data from a in ctx.Accounts where a.AccountId id select new AccountId a.AccountId.. If you look at the code above I query the data from my ctx.Accounts and use it to instantiate my domain objects. In my..

How can I return a custom HTTP status code from a WCF REST method?

http://stackoverflow.com/questions/140104/how-can-i-return-a-custom-http-status-code-from-a-wcf-rest-method

a StatusCode property that can be set. WebOperationContext ctx WebOperationContext.Current ctx.OutgoingResponse.StatusCode.. set. WebOperationContext ctx WebOperationContext.Current ctx.OutgoingResponse.StatusCode System.Net.HttpStatusCode.OK share..

Can you convince a DataContext to treat a column as always dirty?

http://stackoverflow.com/questions/1560513/can-you-convince-a-datacontext-to-treat-a-column-as-always-dirty

a legacy system that I'm talking to with L2S imagine var ctx new SomeDataContext disposed etc keeping it simple for illustration.. disposed etc keeping it simple for illustration var cust ctx.Customers.First just for illustration cust.SomeRandomProperty.. DateTime.UtcNowl cust.UpdatedBy currentUser ctx.SubmitChanges uses auto generated TSQL This is fine but if the..

Get an IDataReader from a typed List

http://stackoverflow.com/questions/2258310/get-an-idatareader-from-a-typed-list

TestEnumerableDataReaderWithIQueryableOfAnonymousType var ctx new NorthwindEntities var q ctx.Orders.Where o o.Customers.CustomerID.. var ctx new NorthwindEntities var q ctx.Orders.Where o o.Customers.CustomerID VINET .Select o new..

Entity Framework 4 - AddObject vs Attach

http://stackoverflow.com/questions/3920111/entity-framework-4-addobject-vs-attach

new Entity So if i'm creating a new Person i do this. var ctx new MyEntities var newPerson new Person Name Joe Bloggs ctx.Persons.AddObject.. new MyEntities var newPerson new Person Name Joe Bloggs ctx.Persons.AddObject newPerson ctx.SaveChanges If i'm modifying.. new Person Name Joe Bloggs ctx.Persons.AddObject newPerson ctx.SaveChanges If i'm modifying an existing Person i do this var..

Save byte[] into a SQL Server database from C#

http://stackoverflow.com/questions/4057748/save-byte-into-a-sql-server-database-from-c-sharp

you'd write something like this using YourDataContextHere ctx new YourDataContextHere SomeClassOfYours item new SomeClassOfYours.. SomeClassOfYours item.ByteContent your byte content here ctx.SomeClassOfYourses.InsertOnSubmit item ctx.SubmitChanges That.. content here ctx.SomeClassOfYourses.InsertOnSubmit item ctx.SubmitChanges That will insert your byte into a column Content..

LINQ to SQL using GROUP BY and COUNT(DISTINCT)

http://stackoverflow.com/questions/448203/linq-to-sql-using-group-by-and-countdistinct

.Distinct .Count Here's a Northwind example using var ctx new DataClasses1DataContext ctx.Log Console.Out log TSQL to.. example using var ctx new DataClasses1DataContext ctx.Log Console.Out log TSQL to console var qry from cust in ctx.Customers.. Console.Out log TSQL to console var qry from cust in ctx.Customers where cust.CustomerID group cust by cust.Country..

How can I get a list of users from active directory?

http://stackoverflow.com/questions/5162897/how-can-i-get-a-list-of-users-from-active-directory

I saw a similar post where this was used PrincipalContext ctx new PrincipalContext ContextType.Domain YOURDOMAIN I have never..

LINQ Expression to return Property value?

http://stackoverflow.com/questions/567963/linq-expression-to-return-property-value

args get some ids to play with... string ids using var ctx new DataClasses1DataContext ids ctx.Customers.Select x x.CustomerID.. string ids using var ctx new DataClasses1DataContext ids ctx.Customers.Select x x.CustomerID .Take 100 .ToArray now do.. a deliberately small batch size to prove it... using var ctx new DataClasses1DataContext ctx.Log Console.Out foreach var..

Compare nullable types in Linq to Sql

http://stackoverflow.com/questions/586097/compare-nullable-types-in-linq-to-sql

put on logging to see what TSQL was generated for example ctx.Log Console.Out LINQ to SQL seems to treat nulls a little inconsistently.. inconsistently depending on literal vs value using var ctx new DataClasses2DataContext ctx.Log Console.Out int mgr int.. literal vs value using var ctx new DataClasses2DataContext ctx.Log Console.Out int mgr int null redundant int for comparison.....

Entity Framework v4.1 LIKE

http://stackoverflow.com/questions/6202036/entity-framework-v4-1-like

AS e WHERE e.Field LIKE 'a b c ' ObjectContext ctx IObjectContextAdapter dbContext .ObjectContext ObjectQuery EntityType.. EntityType query new ObjectQuery EntityType command ctx ObjectResult EtntiyType result query.Execute MergeOption.AppendOnly..