bitfoundation / bitplatform Goto Github PK
View Code? Open in Web Editor NEWBuild all of your apps using what you already know and love ❤️
Home Page: https://bitplatform.dev
License: MIT License
Build all of your apps using what you already know and love ❤️
Home Page: https://bitplatform.dev
License: MIT License
instead of removing callback method, we should return disposal function on register method, like what $scope.$watch of angular returns.
Its base implementation is not Async, but this allows to provide Async implementation, by inheriting DtoSetController and overriding Get method in derived classes.
When repository provides Task<IQueryable> GetAll() method, DtoSetController's Get will call the Async version.
[Function]
[Parameter("firstNumber", typeof(int))]
[Parameter("secondNumber", typeof(int), isOptional: true)]
public virtual async Task<int> Sum(CancellationToken cancellationToken, [FromODataUri]int firstNumber, [FromODataUri]int secondNumber = 10)
{
return firstNumber + secondNumber;
}
As I tested, generated JavaScript & TypeScript codes of html client are ok, but when I take a look at generated $metadata of DefaultAutoEdmBuilder, I see no IsOptional on that and I see bad request exception when I pass firstNumber, but I get the result when I pass both parameters
[Action]
[Parameter("testId", typeof(Guid?))]
public virtual async Task<TestDto> GetOpensCollectionDeliveryOrders(ODataActionParameters actionParameters, CancellationToken cancellationToken)
{
...
}
To support this we've to rename FoundationVSPackageConfiguratio.json to something like FoundationVSPackageConfigurationV1,json. In this naming convention V1 can be V2 etc to show major version of FoundationVSPackage VSIX. Each major Version should have its own git repository branch, Its unique name in visual studio marketplace (For example FoundationVSPacakgeV1.vsix), so It would be possible to have major versions side by side on both github and visual studio marketplace. Developers are allowed to install multiple versions at the same time, and when developers open their visual studio solutions, each installed version of vsix can make a decision about it self. For example FoundationVSPackageV2.vsix will continue to work if FoundationVSPackageConfigurationV2.json is presented near .sln file of solution. It is possible to have multiple .json files for one solution, each of them for some projects of that solution.
I've written this style to make rad grid column titles RTL
thead.k-grid-header > tr > .k-header {
text-align: right;
}
1- Kendo Data Source using JayData OData Provider won't ask $count when there is no page size is specified and at client side, $count will be equal to length of returned data from server.
2- Even asking $count will not execute any kind of query to calculate count, if there is no page size is specified by either $top or DefaultPageSize and $count will be the .Length of returned results of original query. (Query will be executed once).
3- By setting DefaultPageSize to null, requests with no $top specified will retrieve all data. (Query will be executed once)
4- Default ASP.NET Web API OData implementation has a key difference, it has a default page size as a required property, and will apply that in all cases. We're going to remove usages of that implementation from our project.
I was trying to run the bitChangeSetManager on IIS (Windows 10.14393) and I got this error:
IOException: The handle is invalid.
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +1093
System.Console.set_Title(String value) +112 .... AppStartup.cs:34
There was no problem on iis express.
Consider following Dto:
ProductDto { Id , LocationId , Name }
And following Query:
productsRepository.GetAll().Where(p => p.LocationId == currentUserLocationId)
So, sync will get all products located in user's location.
Then we update product's location, and because the query will not return that product to client for that user, sync service won't get its data again. Because sync service at client side gets no change, it will show that product under its old location.
It would be a good idea to have a change history table with sync service integration, so sync service can understand these types of changes.
In the foundation project there are some reference like
/// <reference path="../../foundation.core.htmlclient/foundation.core.d.ts" />
/// <reference path="../../foundation.core.htmlclient/foundation.core.d.ts" />
/// <reference path="../../foundation.viewModel.htmlclient/foundation.model.context.d.ts" />
to some files, but those file does not exist.
and also the foundation.core project does not exist too.
/// <reference path="../foundation.core/typings.d.ts" />
Please make a video for install bit framework
and create a simple web form for data entry by bit framework.
Thanks
<rad-date-picker name="BirthDate" k-ng-model="vm.axaNerkhEstelam.BirthDate" />
<persian-date-picker ng-model="vm.axaNerkhEstelam.BirthDate" />
If I use ng-model on rad-date-picker, changing persian date won't update rad-date-picker, but when I use k-ng-model on rad-date-picker, there won't be any problem.
I have a method that returns a complex type which has never used in any dtos.
we have to consider to these type of complex types in foundation vs package.
Ef core has supported find linq method eventually in latest of it's version and I think it's time to merge all repositories to a one repo
let's do it soon ;))
in bit-framework we've something like this following code
public interface ISomeContract { Task<int> SomeMethodAsync(CancellationToken cancellationToken); int SomeMethod(); }
and suppose this implementation of it's contract
public class SomeImplementation : ISomeContract { public int SomeMethod() { // lots of codes ... return 10; } public async Task<int> SomeMethodAsync(CancellationToken cancellationToken) { return SomeMethod(); // another example: I can remove async modifier from SomeMethodAsync method and this following //try //{ // return Task.FromResult<int>(SomeMethod()); //} //catch (Exception ex) //{ // return Task.FromException<int>(ex); //} } }
we have some options to reuse sync method in async implementation
1)
public Task<int> SomeMethodAsync(CancellationToken cancellationToken) { return Task.Run(() => SomeMethod(), cancellationToken); }
2)
public async Task<int> SomeMethodAsync(CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); return SomeMethod(); }
3)
public Task<int> SomeMethodAsync(CancellationToken cancellationToken) { if (cancellationToken.IsCancellationRequested) { return Task.FromCanceled<int>(cancellationToken); } try { return Task.FromResult(SomeMethod()); } catch (OperationCanceledException oce) { var canceledTaskBuilder = new TaskCompletionSource<int>(); canceledTaskBuilder.SetCanceled(); return canceledTaskBuilder.Task; } catch (Exception e) { return Task.FromException<int>(e); } }
more detail in this following:
how to reuse sync code
We need a mechanism to provide old database instance and new database instance to developer, so developer can migrate its data from old db to new db.
Important notes:
1- Database migration approaches like what Entity Framework Migration provides is not come in handy, because of limitations in SQL lite such as lack of "rename column" etc. This approach is not available in indexedDb too.
2- Developer needs to migrate tables/collections with two way sync. Only those records with ISV = false
I have an action in my DtoController that returns a DTO (SalesBNDetailsDto).
public virtual SalesBnDetailsDto GetSalesBnDetailsByFullBno(ODataActionParameters parameters)
{
string fullBno = (string)parameters["fullBno"];
int bimegozarId = (int)parameters["bimegozarId"];
SalesBnDetailsDto salesBnDetails = _salesBnDetailsProvider.GetInfo(fullBno, bimegozarId);
return salesBnDetails;
}
This Dto contains a property named KhodroDto which is a complex type.
When I see $metadata I can observe that KhodroDto is identified as an entity not as a complex type which in turn causes the action to return nothing for KhodroDto, but other properties of SalesBNDetailsDto are filled appropriately.
When I add edmModelBuilder.ComplexType(); in my customized EITEdmModelProvider.BuildEdmModel the problem is gone and every thing works as expected.
public override void BuildEdmModel(ODataModelBuilder edmModelBuilder)
{
edmModelBuilder.ComplexType<KhodroDto>();
_autoEdmBuilder.AutoBuildEdmFromAssembly(typeof(CarEdmModelProvider).Assembly, edmModelBuilder);
base.BuildEdmModel(edmModelBuilder);
}
For example, whenever we press F2, we should click rad-grid-edit-button of current grid's row, to respect it's ng-disabled if any.
Bit Code Generator does not generate some properties which are Required.
No support for concurrency mode in Bit
JaySvcUtilSample:
Version: {
"concurrencyMode": $data.ConcurrencyMode.Fixed
}
Enum properties have two types of fields: Index & Value (JaySvcUtil)
Bit Sample:
{ name : 'Man' , value : "Foundation.Test.Model.Dto.TestGender'Man'" },
JaySvcUtil Sample:
{ "name": "Man", "index": 0, "value": 3 },
Bit Code Generator does not generate "Reflect define Metadata"
JaySvcUtil Sample:
Reflect.defineMetadata("O1", ["Version"], types["Entity"].prototype)
Bit Code Generator, Generate Action & Function In Camel Case Format
Error: can only have one , <textarea> or child element!
<md-input-container>
<persian-date-picker ng-model="vm.axaNerkhEstelam.BirthDate" />
</md-input-container>
I've got a Dto that has a property named "Id" but it's not a Key and I'm gonna update it's value later using jaydata, but unfortunately it's way seems make some un handled problems
Hi There
I Was Trying To Use Byte Array To Save My Picture But The Code Generator Had Some Issue We That.
What Should I Do?
Into IndexedDb when we save minus value like "-1000"; saved value is "0000000000000000000000000-1000". So, the problem is here when decimal use regex /^0+(?=\d)/ to clear extra zeros; result is some thing like this : "0-1000"
Try /^0+(?!\.)/ instead of /^0+(?=\d)/.
Example: Car.getSalesBnDetailsByFullBno(fullBno='31/1001/46508',bimegozarId=49705)
hi
please limit selection primary key types by developers in bit-framework. for example add IEntityWithDefaultIntKey like IEntityWithDefaultGuidKey and remove IEntityWithDefaultKey generic interface. the best practice for primary key types are Int or Guid. other types should not be selected by developers.
best regards.
How can I display error message to end user for all errors I get from server responses?
Is there any best practice for this?
Thanks in advance.
When a server returns null for one of child request of client (No content), we get an unexpected error at client side.
This happens on $batch requests only.
consider the following code
[Function]
[Parameter("categoryId", typeof(Guid))]
public virtual async Task<Guid[]> GetlocationIdsByCategoryId([FromODataUri]Guid categoryId, CancellationToken cancellationToken)
{
return await _categoryInLocationsRepository.GetAll().Where(c => c.ProductCategoryId == categoryId).Select(c => c.LocationId).ToArrayAsync(cancellationToken);
}
above code makes these error
Build:Type 'string' does not satisfy the constraint 'Entity'.
I want to group some rows and show the group in my radgrid and if I expand group, show all related rows and if I collapse group , hide all related rows
how can i do this in this radGrid?
examples: http://demos.telerik.com/kendo-ui/grid/aggregates
Consider following scenarios:
1- Update from Dto into model when property of model is internal somehow!
2- Raise an exception when we insert an entity which has a version somehow!
Log warning when there is a source/destination project in bit config json file which has no equivalent in current solution
Thanks in advance
Sending Dtos and Complex Types to clients is possible in Web API OData even for those without public default constructor, but its not possible when client sends data to Web API OData Server. This causes developers to making a mistake ,So we've to enfore having public default ctor for dtos & complex types.
Layout problem with Rad Grid on grouping mode: Extra column on both RTL & LTR + > arrow instead of < arrow in RTL mode.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.