breeze

Breeze JS - Repository with EFContextProvider, enabling/disabling OData filtering

本秂侑毒 提交于 2019-12-02 17:47:26
问题 I'm looking to implement a repository pattern with breeze EFContextProvider. In this repository, I would expose a method to query the DB using OData filtering... just as breeze behaves by default. I would also want to expose a method that would ignore OData filtering, and return a list of elements as if it was the default EF Context. So, to sum up, my idea would be to try to do something like this: public class RepositoryBaseEntity<T> : IRepository<T> where T : class { protected Breeze.WebApi

How to use Stored Procedure that accepts Paging Parameters

只愿长相守 提交于 2019-12-02 16:22:51
问题 Any links samples on how to use stored procedure when using breeze, mainly interested in finding out how to extract Paging parameters and set inlinecount value, since stored proc will return that value and take paging parameters. I.E function GetData(int Pageindex,int PageSize, string SP_Input_Para1,string SP_Input_Para2 and so on.... similarly for Update function Update(string SP_Input_Param1, string SP_Input_Param2 etc) Then some how configure Breeze to tell that it should use the following

Using jQuery dynatree with Knockout and Breeze

拥有回忆 提交于 2019-12-02 16:09:52
问题 OK, following the suggestion from PW Kad I'm splitting this part of the question off from where it started on question ID 17973991. I have a viewmodel that utilises a datacontext built around breeze and it fetches the data I want and populates observable arrays. I have a requirement to use data already retrieved by Breeze to populate another (observable) array to use in a treeview. As the existing data does not have the correct fieldnames, I need to be able to create a new array with correct

breezejs: navigation property not added to entity

无人久伴 提交于 2019-12-02 12:11:44
问题 I've configured my WebAPI ODATA service (using 5.0.0-rc1 for $expand and $select support) and everything seems to work fine but navigation properties. The metadata does contain my navigation property (OpenPositions on Mandate) : Then my breeze query is the following: function search() { var query = breeze.EntityQuery.from("Mandates").expand("OpenPositions").inlineCount(); return manager.executeQuery(query.using(service)).then(function (result) { logger.info(result); }).fail(function (error) {

How to use Stored Procedure that accepts Paging Parameters

对着背影说爱祢 提交于 2019-12-02 11:13:20
Any links samples on how to use stored procedure when using breeze, mainly interested in finding out how to extract Paging parameters and set inlinecount value, since stored proc will return that value and take paging parameters. I.E function GetData(int Pageindex,int PageSize, string SP_Input_Para1,string SP_Input_Para2 and so on.... similarly for Update function Update(string SP_Input_Param1, string SP_Input_Param2 etc) Then some how configure Breeze to tell that it should use the following function on the server for Get & Update,Delete,Insert etc. Or a better way could be that For Get use

Concurrency/ToDo Sample not working

白昼怎懂夜的黑 提交于 2019-12-02 09:51:05
I was trying out the ToDo sample and ran into an unhandled Excaption while trying out the Concurrency Handling. The dataservice.js contains these lines in saveFailed(error) method: if (detail && detail.ExceptionType.indexOf('OptimisticConcurrencyException') !== -1) { // Concurrency error reason = "Another user, perhaps the server, may have deleted one or all of the todos."; manager.rejectChanges(); // DEMO ONLY: discard all pending changes } The client never gets to this point due to an unhandled OptimisticConcurrencyException in: [HttpPost] public SaveResult SaveChanges(JObject saveBundle) {

Breeze BeforeSaveEntities: how to modify savemap

帅比萌擦擦* 提交于 2019-12-02 08:53:24
问题 I read the following from the Breeze documentation about BeforeSaveEntities: "Entities may be added or removed from the map returned by this method". So I suppose I can add a new instance of EntityInfo to the saveMap. My question is: how can I do that? Is there any example of that anywhere? I can perfectly loop through the dictionary. But since EntityInfo has no constructor, and all its fields are get only, I feel a bit stuck here. Any help is welcome. Thanks 回答1: Ok, here is a very contrived

Breeze.js query does not update knockout view

末鹿安然 提交于 2019-12-02 08:51:41
I am querying data via breeze.js which works fine the first time. The second time the view isn't updated. html <a id="linkQDate">Order by Newest</a> <a id="linkQScore">Order by Score</a> <div id="questionWrapper"> <ul data-bind="foreach: results"> <li> <strong><span data-bind="text: Score"></span></strong> <span data-bind="text: Titel"></span> </li> </ul> </DIV> js $(document).ready(function () { var manager = new breeze.EntityManager('/breeze/dbentities'); var isApplied = false; var dmodel; $("#linkQDate").click(function () { var query = breeze.EntityQuery.from("Questions").orderBy("Date");

My unmapped properties in breeze does not seems to work whith a projection

自闭症网瘾萝莉.ら 提交于 2019-12-02 08:11:17
I have the following Entity: public class Invoice { [Key] public int Id { get; set; } public DateTime? ArchiveDate { get; set; } public DateTime? ClotureDate { get; set; } ... } I would like to know whether my invoice is archived or closed by using a kind of flag (boolean). For that purpose I added 2 unmapped properties in my breeze entity like this: public class Invoice { [Key] public int Id { get; set; } public DateTime? ArchiveDate { get; set; } public DateTime? ClotureDate { get; set; } [NotMapped] public bool Archived { get { return ArchiveDate.HasValue; } } [NotMapped] public bool

Controller not filtering data in Breeze query in DotNetNuke Module

a 夏天 提交于 2019-12-02 08:08:21
问题 I am trying to include the basic Breeze sample in a DotNetNuke module (it works fine in a standalone WebAPI project). To simplify things I remove the client and will just refer to the URL JSON calls I make in the Chrome browser. I can see my metadata and a full list of items, eg: http://www.dnndev.me/DesktopModules/framework/api/breeze/dare/metadata http://www.dnndev.me/DesktopModules/framework/api/breeze/dare/todos however, when I try to filter the list from the URL, it always returns the