Base solution for your next web application

Activities of "ofir1234"

Hi. We are using ABP for a website which is divided to three zones: red zone, green zone, yellow zone. In the server side we want to know for each api call, from which zone it came from. Our solution now is just sending the zone as a parameter for each api call. What we want to do is to use routing for that. Is there a way changing the routing somehow to support this idea? For example, all calls coming to /app/services/red/someAppServicewill/someMethod will actually go to the someMethod in the someAppService, and the parameter "zone" will be set to red.

Thanks in advance.

Hi. Recently we've updated some (non-ASP.NET Boilerplate) packages like EntityFramework and more (around 20 packages that visual studio asked to update). The problem is that we now get lots of weird exceptions like "unknown method" from Boilerplate's dll's. We can't really know where the problems are exactly because they come from some Boilerplate dll's we cannot see. Does it mean that if I'm working with ASP.NET Boilerplate, I am not allowed to update packages that ASP.NET Boilerplate framework relies on ? Why isn't there a mechanism which tells that Boilerplate dll's are depended on some other specific dll versions (like entity framework v4.0) so this update would be restricted and the project wouldn't be destroyed? (Boostrap, For example, has this line written in their nugget : Dependencies : jQuery (>= 1.9.1 && < 3.0.0) ) As for now we are working on downgrading those nuget packages (but it's like impossible cause we don't know the previous versions). Anyway, the project is very unstable now (I'm getting these errors only on runtime!). That do you suggest? (We are using the latest ASP.NET Boilerplate versions and nuggests)

Thanks.

Hi. I read a lot of the abp documentation about the generic repository and the uow pattern. But actually I find it hard to find if you have this ability : a generic unit of work working with a generic repository. The concept is explained widely here: <a class="postlink" href="http://www.codeproject.com/Articles/770156/Understanding-Repository-and-Unit-of-Work-Pattern">http://www.codeproject.com/Articles/770 ... rk-Pattern</a> (I'm talking about the mix between the generic uow and the generic repository they are talking about in the end of the article)

Usage example:

var x = uow.Repository<Contact>().GetAll().ToList());
var y = uow.Repository<Manager>().GetAll().ToList());

This means that I can hold (in my application service) an object called uow and then (at runtime) decide to access the contacts repository or the managers repository or any other repository I want. This also saves me from injecting (in the constructor of my application service) all of the repositories I need, for example :

Public MyAppService(IRepository<Contact> cr, IRepository<Manager> mr)
{
// ...
}

If I have something like 15 types of entities, this constructor is going to be huge and its a bit overhead. The best approach is if could only inject this uow object and select my repository from this uow (as I showed in the previous code and in the article example).

So, do you have any support for this concept / can you give a short example for how to do it in ASP.NET Boilerplate?

Thanks :)

Hi. In regular EntityFramework I can just write

Context.Blogs.include(b=>b.posts):

In order to automatically fill posts inside my Blog context. Without this, I m getting null in the posts field when reading the Blogs table using the GetAllList command. How can I do it in boilerplate ? Cause all I do is writing : IDbSet<...> Blogs And that's all I do in order to define the context in boilerplate.

Actually I want to do what's written in here : <a class="postlink" href="https://msdn.microsoft.com/en-us/data/jj574232.aspx">https://msdn.microsoft.com/en-us/data/jj574232.aspx</a>

Thanks

Hi. I'm working with your Dynamic Web API Layer and it's very useful, but I want to understand how can I throw an error to the web client.

I have a client request, defined this way :

abp.services.app.trends.deleteSavedQuery($scope.loadQuerySelectedId)
   .done(function (result) {
      abp.message.info("Saved query deleted successfully");
   });
   //here I want to catch an error (you can't delete a query that wasn't written by you)

The service code in the server is something like this :

[HttpGet]
public void DeleteSavedQuery(int queryId)
{
if (_userManager.AbpSession.UserId == getQueryId(queryId))
   {
      _savedQueriesRepo.Delete(queryId);
   }
   else
   {
      //Here I want to throw an unauthorized error (403) with a message : 'you can't delete a query that wasn't written by you'
   }
}

How can I throw this error from the server and catch it nicely in the client, doing it the best and conventional 'ASP.NET Boilerplate' way ?

Thanks.

Hi. Is there an easy way to change the admin password via code ? I tried resolving the UserManager and then changing the password for user no 1, like this :

await _userManager.ChangePasswordAsync(1, "123qwe","blabla");

But the password is still the same. So how can I do it ?

Thanks.

Hi. I've noticed that client browsers aren't refreshing .js files and .html files after I publish a new version of my ASP.Net Boilerplate based website. This is because the browsers have some caching, and I need do something like that in order to tell the clients that new .js version is here : <a class="postlink" href="http://stackoverflow.com/questions/32414/how-can-i-force-clients-to-refresh-javascript-files">http://stackoverflow.com/questions/3241 ... ript-files</a>

I wonder if you have any magic thing in ASP.Net boilerplate to force clients to reload new .js and .html files when I deploy new versions.

Hi. I m using your module zero successfully for couple of months now. Thank you for that. I wonder if it's possible to add a windows authentication support. If I m creating a new ASP .NET project, I can choose in the right pane "windows authentication". But your template is already made, so how can I use some windows authentication features? For example, I would like to display "hello ezh276" where this name represents the windows login.

Thanks.

Hi. I am using your template and I must say it's a life saving project. I'm using the angular+entity framework version.

I have this problem : The server startup takes about 15 seconds (I'm restarting the iis and then surfing into my local website and it's taking about 15 seconds) - That's acceptable . The problem is, if no user surf into my website , which means - the website is idle, for about 1 hour, the next time a user is trying to open the website, it takes again about 10-15 seconds for the page to load (after that I have again an hour with super fast performance, less than 1s for loading any page, from any computer). But this 15 seconds of waiting after no user surfs into my website is pretty annoying. What could be the problem ? Thanks.

Hi. I have an application service called TrendsService. This service returns "normal" results like strings and ints. The problem is, I want sometimes to return a custom http-error (return a IHttpActionResult) from this service. I also want a method which returns a file to the client (which means I'm returning an HttpResponseMessage and fill it with a Stream Content). I know these things aren't related to the application level, but you have this automatic api-controller maker in ASP.Net Boilerplate. Does it have some flags to support such things ? (I know I can write [HttpGet] above a method in the service, but I need a little more than that. I need to return HTTP responses.) So, do you have any support for that or the only option is to create another controller which contains all the HTTP-related methods ? This makes my solution have two files : a TrendsController.cs and a TrendsService.cs which makes things look a bit messy.

Thanks

Showing 1 to 10 of 13 entries