.net-4.5

List<> .ForEach not found [duplicate]

倖福魔咒の 提交于 2019-12-21 20:46:54
问题 This question already has answers here : Is the List<T>.ForEach() method gone? (3 answers) Closed 6 years ago . I am porting a Windows Phone app to Win 8, and I have found this stumbling block, but cant find the solution. I have a: List<items> tempItems = new List<items>(); and ObservableCollection<items> chemists = new ObservableCollection<items>(); I have added items to my tempItems etc, so then I do this: tempItems.OrderBy(i => i.Distance) .Take(20) .ToList() .ForEach(z => chemists.Add(z))

System.Web.Optimization changes order of js files when minifying javascript

蓝咒 提交于 2019-12-21 17:44:07
问题 I am observing a very peculiar behaviour when minifying files with System.Web.Optimization , I am already using IBundleOrderer that works fine in preserving file order when I am not minifying the files public class RespectGivenBundleOrder : IBundleOrderer { public IEnumerable<BundleFile> OrderFiles(BundleContext context, IEnumerable<BundleFile> files) { return files; } } public static void RegisterTestingBundle(BundleCollection bundles) { var bundle = new ScriptBundle("~/OnTheMoveWebFiles

RESTful authentication. Client-side, stateless unauthentication

夙愿已清 提交于 2019-12-21 15:07:14
问题 I'm implementing a set of RESTful services for some developments and one of these is an authentication service . This authentication service authenticates two kinds of identities: Applications . AppKey-based authentication so clients must register for a key in order to access to the rest of the services . Users . Well-known credentials (user+password)-based user authentication so humans and machines can work with these RESTful services through client applications. These RESTful services are

SignalR .NET Client doesn't support WebSockets on Windows 7

这一生的挚爱 提交于 2019-12-21 12:57:09
问题 I've written a small echo-server (.net 4.5), console client (.net 4.5) and web client using SignalR and example presented here. Server is hosted in IIS8/Win8. Then I ran both clients on Win7. and I see that web client in Chrome uses webSockets, while console app client uses serverSentEvents. If I run console client on Win8, then webSockets transport is in use. Is it true that SignalR .NET client will use webSockets only on Win8 and higher? 回答1: It's correct: .NET client uses WebSockets only

SignalR .NET Client doesn't support WebSockets on Windows 7

女生的网名这么多〃 提交于 2019-12-21 12:57:02
问题 I've written a small echo-server (.net 4.5), console client (.net 4.5) and web client using SignalR and example presented here. Server is hosted in IIS8/Win8. Then I ran both clients on Win7. and I see that web client in Chrome uses webSockets, while console app client uses serverSentEvents. If I run console client on Win8, then webSockets transport is in use. Is it true that SignalR .NET client will use webSockets only on Win8 and higher? 回答1: It's correct: .NET client uses WebSockets only

BootstrapContext is null on ClaimsIdentity

耗尽温柔 提交于 2019-12-21 10:08:09
问题 I have created a new ASP.NET MVC application with .NET 4.5. I have successfully set up authentication with an STS. The authentication flow is working fine and I am able to get the ClaimsIdentity, containing the desired claims, on Thread.CurrentPrincipal. Now I need the bootstrap token to secure the calls to my service layer. I have set the saveBootstrapContext to true on the identityConfiguration element. <system.identityModel> <identityConfiguration saveBootstrapContext="true"> However, the

Where does an async Task throw Exception if it is not awaited?

你。 提交于 2019-12-21 09:10:12
问题 I have the following example: (please also read comments in code, as it will make more sense ) public async Task<Task<Result>> MyAsyncMethod() { Task<Result> resultTask = await _mySender.PostAsync(); return resultTask; // in real-life case this returns to a different assembly which I can't change // but I need to do some exception handling on the Result in here } let's assume the PostAsync method of _ mySender looks like this: public Task<Task<Result>> PostAsync() { Task<Result> result =

How do I kick off an entity stored procedure in EF6 async and not wait for a return?

安稳与你 提交于 2019-12-21 07:11:59
问题 I'd like to just punt a call over to the SQL Server and not wait for a return. I have an imported Entity Function from a Stored Procedure that I'd like to call asynchronously this way in Entity Framework 6.0.0-rc1. Is this possible? What's the syntax? Entity Function: RecalculateBudgetNumbers(int id) 回答1: Start a new Task that creates a fresh data context and invokes that function. Just don't wait/await that task. Let it run by itself to completion. Make sure to log errors. Don't swallow

Enum as Key in entity framework 5 throwing error on many to many joins

廉价感情. 提交于 2019-12-21 06:48:53
问题 OK, this is a bit lengthy / obscure, but I'm getting an odd error in specific situation where I use an Enum as a table Key and attempt to query against the table while including more than one many-to-many related entities. The error, from the example code below is: The type of the key field 'DietIs' is expected to be 'MvcApplication8.Models.DietIs', but the value provided is actually of type 'System.Int32'. In a .net 4.5 web project, I have the following entity configuration : public enum

Service not accessible when “Enable 32-Bit Applications” set to true

无人久伴 提交于 2019-12-21 06:43:47
问题 On the development server I use IIS Veresion 7.5.7600.16385 And a Service compiled for .Net 4.5.1, Any CPU The service works fine on the development server (Win Server 2008 R2). On the client's production server however I get strange problems: (Same IIS Version, same OS version) As soon as I set "Enable 32-Bit Applications" the service's URL is no longer accessible in a browser . (Page not available) (I need the 32Bit mode because the service uses some legacy COM components) What may cause