Code Monkey home page Code Monkey logo

bitplatform's People

Contributors

0xsamman avatar 1saeedsalehi avatar behzad888 avatar bitsali avatar cyrus-sushiant avatar darius-khll avatar farshaddavoudi avatar fatemehnoroozi avatar hamedhajiloo avatar hamedmoghadasi avatar khashayar-pakkhesal avatar lone-mirza avatar maryamhdr avatar md23mh avatar meysambahadori avatar mhrastegari avatar milad-karimifard avatar mirza-developer avatar mohabbati avatar msangtarash avatar msynk avatar rezakargar avatar rypedram avatar saeedhalab avatar sajadkardel avatar somayeebrahimi avatar taha-ghadirian avatar ysmoradi avatar zahra-yousefi avatar zoha-shobbar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitplatform's Issues

Make DtoSetController's default get IQueryable<TDto> method async

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.

OData operation configuration's optional parameter is not working properly

       [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

Ability to have multiple Foundation VSPackage extensions side by side

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.

Enhanced OData Queryable attribute

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.

Console.set_Title error on running sample on IIS

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.

Sync Service - Sync History integration

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.

file not found

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" />

complex without dto issue

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.

a best way to reuse sync code in async method

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

Database schema change between app versions management

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

ComplexType is Identified as Entity in $metadata

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);
 }

class diagram of car-spa tools

The Diffrence Between jaysvcUtil and Bit Html Client Proxy Generator

  1. Bit Code Generator does not generate some properties which are Required.

  2. No support for concurrency mode in Bit
    JaySvcUtilSample:
    Version: {
    "concurrencyMode": $data.ConcurrencyMode.Fixed
    }

  3. 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 },

  4. Bit Code Generator does not generate "Reflect define Metadata"
    JaySvcUtil Sample:
    Reflect.defineMetadata("O1", ["Version"], types["Entity"].prototype)

  5. Bit Code Generator, Generate Action & Function In Camel Case Format

Non key property ("Id") in Dto problem

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

negative value problem in decimal object

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)/.

add best practice for select Primary key by developers

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.

Problem with $batch returns null

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.

Can't return Task<List<Guid>> in controller

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'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.