How do I write a breeze Predicate equivalent to the following SQL [closed]

微笑、不失礼 提交于 2020-02-05 07:05:13
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . SELECT * FROM Table WHERE FirstName = 'Wilson' AND (START_DATE = '1/1/2014' OR START_DATE > '1/2/2014') 回答1: Assume you have controller and it has: [HttpGet] public IQueryable<Tables> GetTables() { return _contextProvider.Context.Set<Tables>(); } Create Predicate: var p1 = new breeze.Predicate

Does Breeze work with Table Per Hierarchy (TPH)

廉价感情. 提交于 2020-01-25 00:38:06
问题 I'm trying to plug BreezeJs into an existing datastructure and getting an error in the meta data fetch. I can replicate this by adding the following to the CarBones sample namespace CarBones.Models { public abstract class VanBase { public int Id { get; set; } public string Manufacturer { get; set; } public int Wheels { get; set; } } public class BasicVan : VanBase { } public class LiveriedVan : VanBase { public string Livery { get; set; } } } then in the context public DbSet<VanBase> Vans { did not detect my errors on my nested observableArray

陌路散爱 提交于 2020-01-24 10:07:45
问题 I develop a project with Durandal/Breeze using intensive Knockout bindings. I have a view which is using the following observable: packing - description - weight - ... - isotopes - name - activity - ... As you can see above: my packing observable contains an isotopes observableArray inside. This packing object is filled from breeze with a query. var query = entityQuery.from('Packings') .where('id', '==', packingId) .expand('isotopes'); I try to set validation in place for all of this using ko

Breeze with a Unit Of Work/Repository pattern

安稳与你 提交于 2020-01-22 14:17:04
问题 I was just wondering how I should go about implementing breeze's EFContextProvider in a separate data layer project. Also, since that project is a class library and not an MVC 4 application, how should I include this into my project? I don't really need the whole bag of tricks that is in the Breeze NuGet package, just EFContextProvider stuff. I want to implement a Unit of work pattern using the EFContextProvider DbContext wrapper, like John Papa has done in his wonderful pluralsight course.

How to call an arbitrary service for saving changes with breezejs?

女生的网名这么多〃 提交于 2020-01-17 08:29:13
问题 It sounds like the SaveChanges of BreezeJS is great for quick demos, but most real life applications need some sort of unit of work, business requirements, and/or sanity checks before actually saving to the data store. Is there a way to integrate BreezeJS with an ajax call that deals with inserting, deleting, and or updating the data rather than using SaveChanges? 回答1: Breeze allows you to both change the server endpoint for 'SaveChanges' via the SaveOptions.resourceName property. (See the

where doese breeze fits into ntier architecture

家住魔仙堡 提交于 2020-01-17 03:53:25
问题 i am Trying to fit in breezeJS with my existing architecture. I have a structure like html/JS/Angular :: based view using hot-towel angular. web api controllers :: whom the view calls. Services layer :: that is being called from Web api. Any business logic goes here. Unit of Work :: And (if) business logic requires to talk to data base for CRUDs it calls UOW. Repository Pattern :: UOW is actually wrapping repositories. and repositores in turn talking to DbContexts. Uptill now i was able to

Angular and Breeze multiple EntityManagers

。_饼干妹妹 提交于 2020-01-17 02:52:24
问题 My angular application uses Breeze and encapsulates the breeze calls within a datacontext service. How can I use this service with different EntityManagers? I am thinking that I need to abandon using the datacontext as an angular service in this situation, since it seems like it is going to require maintaining state. How do others deal with this? I really hate not being able to use the angular service, but I also want to have re-use of the datacontext with a different EntityManager. 回答1: I

Breeze.JS for SharePoint 2013 error saving changes

。_饼干妹妹 提交于 2020-01-16 18:48:29
问题 The object extraMetadata is undefined and throwing an error on line 247 of breeze.labs.dataservice.sharepoint.js rawEntity.__metadata = { 'type': aspect.extraMetadata.type }; I suspect it is because I have not defined the type found in __metadata object on my entity definitions for breeze. Any suggestions on how to define my type correctly would be very welcome! Here is my type definition for one of the objects. models.Project = { name: 'Project', defaultResourceName: 'getbytitle(\'Projects\'

Breeze inlineCount is undefined

北战南征 提交于 2020-01-14 04:56:07
问题 I'm doing a query: var query = entityQuery.from('Items').where(fullPredicate).orderBy(sortingColumn + ' ' + ordering).skip(numOfEntities * (pageNum - 1)).take(numOfEntities).inlineCount(); return manager.executeQuery(query) .then(querySucceeded) .fail(queryFailed); Controller looks like this: [Queryable(AllowedQueryOptions = AllowedQueryOptions.All, AllowedFunctions = AllowedFunctions.AllFunctions, MaxNodeCount = 10000)] [HttpGet] public IQueryable<Item> Items() { return _contextProvider

Breeze Offline Mode Issues

二次信任 提交于 2020-01-14 03:11:12
问题 UPDATE: Here is a plnkr to illustrate the problem Scenario in offline mode You create an entity and store it in the localstorage Breeze generates a tempKey: EmployeeId: -1 and populates a tempKeys array with the EmployeeId: -1 . Every thing is all good and great. Later on, (the application was terminated the device was turned off...) you import the stored data and create a new entity. So Breeze loads the stored data sees the TempKeys of EmployeeId: -1 and