That worked! Thanks!
Fixed it! It was as you said, a naming problem. Thanks!
But as usual another error raises from the ashes: I added more entitites to my project and the first couple of entities I migrated one at a time but realised you could migrate all at the same time. So I deleted the tables that I had migrated directly in the SQL Server Object Explorer aswell as the migration code, and then I ran the Add Migration command when every entity was included... Success!
But when I run the Update-Database the following error appears:
Error Number:15248,State:1,Class:11 Either the parameter @objname is ambiguous or the claimed @objtype (OBJECT) is wrong.
I have tried to rename the entities to ensure the uniqueness and I also tried with deleting the migration code and Add it again. Still the same problem...
Note: Inbetween these actions I added a column to dbo.AbpUser directly with the SQL Server Object Explorer. But when I realized that could be the problem I immediately deleted it.
Is it problematic to work that directly with the database or is it prefered to use other means?
Sorry for the inconvenience / Julian
Woops, here it is.
namespace Expertspel.Sessions.GetBetTypesAppService
{
public class BetTypesAppService : IBetTypeAppService
{
private readonly IRepository<BetType> _bettypeRepository;
public BetTypesAppService(IRepository<BetType> bettypeRepository)
{
_bettypeRepository = bettypeRepository;
}
public ListResultOutput<BetTypeListDto> GetBetTypes(GetBetTypesInput input)
{
var bettypes = _bettypeRepository
.GetAll()
.WhereIf(
input.Filter.Count()!=0,
p => p.BetTypeCode.Contains(input.Filter) ||
p.BetTypeName.Contains(input.Filter)
)
.OrderBy(p => p.BetTypeCode)
.ThenBy(p => p.BetTypeName)
.ToList();
return new ListResultOutput<BetTypeListDto>(bettypes.MapTo<List<BetTypeListDto>>());
}
}
}
Followingg error pops up in my browser error handler:
Error: [$injector:unpr] http://errors.angularjs.org/1.4.0/$injector/unpr?p0=abp.services.app.betTypeProvider%20%3C-%20abp.services.app.betType%20%3C-%20tenant.views.bet.index
Any Idea what could be the problem?
1: Here I get the following errors:
Error: [$injector:unpr] <a class="postlink" href="http://errors.angularjs.org/1.4.0/$injector/unpr?p0=abp.services.app.tenantBetTypeProvider%20%3C-%20abp.services.app.tenantBetType%20%3C-%20tenant.views.bet.index">http://errors.angularjs.org/1.4.0/$inje ... .bet.index</a> at Error (native) at <a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:6:416">http://localhost:6234/Scripts/angular.min.js:6:416</a> at <a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:40:204">http://localhost:6234/Scripts/angular.min.js:40:204</a> at Object.d [as get] (<a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:38:175">http://localhost:6234/Scripts/angular.min.js:38:175</a>) at <a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:40:278">http://localhost:6234/Scripts/angular.min.js:40:278</a> at d (<a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:38:175">http://localhost:6234/Scripts/angular.min.js:38:175</a>) at Object.e [as invoke] (<a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:38:445">http://localhost:6234/Scripts/angular.min.js:38:445</a>) at We.$get.Q.instance (<a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:79:299">http://localhost:6234/Scripts/angular.min.js:79:299</a>) at M (<a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:60:483">http://localhost:6234/Scripts/angular.min.js:60:483</a>) at g (<a class="postlink" href="http://localhost:6234/Scripts/angular.min.js:54:300">http://localhost:6234/Scripts/angular.min.js:54:300</a>) <div ui-view="" class="fade-in-up ng-scope">
2: Couldnt find any getBetType or anything like that in the Network tab.
3: Couldnt even find a log file...
BetTypeAppService:
class BetTypeAppService : ExpertspelServiceBase, IBetTypeAppService
{
private readonly IRepository<BetType> _betTypeRepository;
public BetTypeAppService(IRepository<BetType> personRepository)
{
_betTypeRepository = personRepository;
}
public ListResultOutput<BetTypeListDto> GetBetTypes(GetBetTypeInput input)
{
var betType = _betTypeRepository
.GetAll()
.WhereIf(
!(input.Filter==null),
p => p.BetTypeCode.Contains(input.Filter) ||
p.BetTypeName.Contains(input.Filter)
)
.OrderBy(p => p.BetTypeCode)
.ThenBy(p => p.BetTypeName)
.ToList();
return new ListResultOutput<BetTypeListDto>(betType.MapTo<List<BetTypeListDto>>());
}
}
And the get class
class GetBetTypeInput:IInputDto
{
public string Filter { get; set; }
}
[AutoMapFrom(typeof(BetType))]
public class BetTypeListDto : FullAuditedEntityDto
{
public string BetTypeCode { get; set; }
public string BetTypeName { get; set; }
}
The interface for BetTypeAppService:
interface IBetTypeAppService : IApplicationService
{
ListResultOutput<BetTypeListDto> GetBetTypes(GetBetTypeInput input);
}
And finally the AppServiceBase class:
public abstract class ExpertspelAppServiceBase : ApplicationService
{
public TenantManager TenantManager { get; set; }
public UserManager UserManager { get; set; }
protected ExpertspelAppServiceBase()
{
LocalizationSourceName = ExpertspelConsts.LocalizationSourceName;
}
protected virtual Task<User> GetCurrentUserAsync()
{
var user = UserManager.FindByIdAsync(AbpSession.GetUserId());
if (user == null)
{
throw new ApplicationException("There is no current user!");
}
return user;
}
protected virtual User GetCurrentUser()
{
var user = UserManager.FindById(AbpSession.GetUserId());
if (user == null)
{
throw new ApplicationException("There is no current user!");
}
return user;
}
protected virtual Task<Tenant> GetCurrentTenantAsync()
{
return TenantManager.GetByIdAsync(AbpSession.GetTenantId());
}
protected virtual Tenant GetCurrentTenant()
{
return TenantManager.GetById(AbpSession.GetTenantId());
}
protected virtual void CheckErrors(IdentityResult identityResult)
{
identityResult.CheckErrors(LocalizationManager);
}
}
Okey so when i read the summary in the base class I may have found out what I have done wrong, should I insert the getBetType method in the base class too?
Hi!
Regarding the Azure deployment, did you guys deploy it from visual studio or from some other platform?
Solved! Yes, I marked it as embedded but used the wrong key, I used sv-SE instead of just sv...
My bad! Thanks anyway!
/Julian