Base solution for your next web application

Activities of "cicciottino"

thanks a lot, it goes like a rocket :-)

only a question for didactic purpose..

the exception caught from this class(in my case) indicates that:

Source = "Abp.Web.Api"
Message = "MSDTC sul server 'OLSAITNB-01' non è disponibile."

the problem is clear: the MSDTC on my machine was Disabled (Distributed Coordinator Transaction Services) ,so i enabled it and evertihing worked

but, what is not clear for me is the source of the exception...

i supposed that, if a problem was generated from something related to the "transaction", the exception should be generated from the "Data" layer (the repository for example, or at least, in the "application layer" where the UnitOfWok is managed, is it right?), <ins>anyway not from a "Adp.Web.Api" layer</ins>. can it be that the source indicated in the "source property" is not so accurate and is referred to the outer layer? or, i'm not understanding how it works?

i aspected that the source of the exception was different

i hope to have been clear enough to express my doubt.

  1. downloaded the latest version of the project (SimpleTask)
  2. changed the connectionstring to a new empty database
  3. "Play" on visualstudio

got this javascript error :

Unhandled exception at line 105, column 5 in
http://localhost:6247/Abp/Framework/scripts/libs/abp.sweet-alert.js

0x800a138f - Errore di run-time di JavaScript: Impossibile recuperare la proprietà 'on' di un riferimento nullo o non definito

sorry for the italian message bu i think is comprehensible

Are you working on SimpleTaskSystem? -----> YES

Did you create database using Update-Database command? -----> NO, it was beenautomatically generated on the application startup

Probably tou're getting another exception. See Logs folder in web project.

it doesn't seem to show "ERROR" level labels, only "DEBUG" and "INFO" into the log file. anyway the messages as well seems to be only idication of successfully task.

was it important that the database should be generated manually by me with Database-Update command? is it mandatory?

the same error even if i genereate the database with Update-Database...

i downloaded the project after you moved abp.sweet-alert.js to bundle (on github)

PS: On the Durandal Projet everything works, on the Angular one got this

yep, it was cache browser fault :-/ thanks

i did so, but i don't like

in the application layer

public DeleteDocumentOutput DeleteDocument(DeleteDocumentInput input)
        { 
            var document = _documentRepository.FirstOrDefault(input.Id); 
            if (document == null) 
             { 
                throw new Exception("Can not found the document!"); 
             } 

 
            _documentRepository.Delete(document);

            return new DeleteDocumentOutput 
            {
                Id = document.Id   //<----
            }; 
        }

in the angular controller

documentService.deleteDocument({
                    id: document.id
                }).success(function(value) {
                    

                    vm.documents.forEach(function (element, index, array) {
                        if (element.id === value.id) {
                            vm.documents.splice(index,1);
                        }
                    });

                    vm.refreshDocuments();
		});

could i do it better?

Good!

Answer

you're right i've duplicated the DbSet's

so now i got this error on the Account/Login

There should be a 'Default' tenant if multi-tenancy is disabled!

where i should provide this default value? in the model? in the seed method? directly into the db?

thanks a lot, i didn't know the existance of this class!

so i've simplified my repo(se below) to restrict the research field but the problem

persist. the strange thing is that the execution is repeted twice (like in async way)

my ApplicationService (PoiAppService):

public class PoiAppService : ApplicationService, IPoiAppService
    {
        private readonly IPoiRepository _poiRepository;

        public PoiAppService(IPoiRepository poiRepository)
        {
            _poiRepository = poiRepository;
        }

        public GetPoisOutput GetPois()
        {
            var pois = _poiRepository.GetAllPois();
            
            return new GetPoisOutput
            {
                Pois = Mapper.Map<List<PoiDto>>(pois)
            };
        }

    }

my repository (PoiRepository)

public class PoiRepository : AbpZeroSampleRepositoryBase<Poi, long>, IPoiRepository
    {
        public PoiRepository(IDbContextProvider<AbpZeroSampleDbContext> dbContextProvider)
            : base(dbContextProvider)
        { 
        }

        public List<Poi> GetAllPois()
        {
            var query = GetAll();
            query.Where(x=>x.Id == 91);  //an existing id, just to test
            
            return query.OrderByDescending(x => x.Name).ToList(); 
        }
    }

i've notice also that: in the browser's developer tool, the script "GetAll.js" is

downloaded 2 times, sholud it be unique, really? In an old example project "SimpleTaskProject" i see only one "GetAll.js" (the only

difference is that my project has ModuleZero installed (from the template) is this script generated on applicationLayer basis? how can i investigate deeply?

see the image

Showing 1 to 10 of 24 entries