Mukil Deepthi

0

votes
0

answer
2

views

angular 7 how to access element by id defined in parent component from child component template

I am using primeng multiSelect control in the child component. i want this to be appended to the element defined in the parent component as shown above. the above code failed when i run npm run build:prod. it can't access popupContent in the child. can anyone help how to access the parent element in...
Mukil Deepthi
1

votes
1

answer
367

views

Oidc-client in Angular2 with hashlocation giving error in redirect_uri

I am following the Authenticating Angular2 with Oidc-client and trying to implement the authentication part. Because the angular2 is using { provide: LocationStrategy, useClass: HashLocationStrategy } my urls will change to for eg: http://localhost:4200/#/dashboard. In the identityserver and also o...
Mukil Deepthi
1

votes
1

answer
38

views

Angular2 how to use the service in providers from packaged module into another module

I have an angular2 application with Core package and Host package. core package is used in host package. I am developing an authentication service which is defined in core package. But i want to service to be used in host package. so that i can use authentication to the whole application. I want to...
Mukil Deepthi
1

votes
1

answer
32

views

C# HttpTriggered Azure funtion get content as interface from request

I am writing a simple http trigger azure function in c# as shown below. [FunctionName('CommandReceiver')] public static async Task Run( [HttpTrigger(AuthorizationLevel.Anonymous, 'post', Route = null)] HttpRequestMessage req, [ServiceBus('cqrs-commands', AccessRights.Listen, Connection = '', EntityT...
Mukil Deepthi
1

votes
2

answer
34

views

double quote inside single quote in angular1.x directive not working

I am creating an angular directive as shown below to display a logo in the header. the background image is not appearing and i doubt this is because of wrong quotes inside single quote. can anyone please help me to fix this? angular.module('Common') .directive('mainHeader', [ function () { /// Mar...
Mukil Deepthi
1

votes
1

answer
41

views

Angular how to pass array of string to a header parameter

I am writing a custom http interceptor. I want to pass array of string values to a headername. In my webapi , i am getting as comma separated string and not as array. How to get it as array? Interceptor code: intercept(req: HttpRequest, next: HttpHandler): Observable { req = req.clone({ setHeaders:...
Mukil Deepthi
1

votes
1

answer
123

views

Angular material how to position mat-sidenav top or bottom

I am new to angular material. From angular material doc i can see it can be positioned 'start' or 'end'.
Mukil Deepthi
1

votes
4

answer
407

views

Validate pipe separated line against specified format

I am reading lines from a text file. each line is pipe separated. I want to validate the line i.e each item is according to a specified format after splitting by delimiter. eg:- Here is my line D|111111|87654321|Bar|BCreace|GBP|24/08/2010 Check if the above line follows the following format for eg:...
Mukil Deepthi
1

votes
1

answer
205

views

NHibernate session getting closed though registered type using Unity per request

I am using FluentNHibernate and Unity to use in my asp.net webapi. I am using Unit of work pattern to configure the ISession. I am getting error as 'Session is closed! Object name: 'ISession'. Can anyone help what am i doing wrong here? Please find below my code. unityconfig: container.RegisterType(...
Mukil Deepthi
1

votes
1

answer
404

views

NHibernate queryover how to query a field which starts with any value in a list

How to write a proper nhibernate queryover query to select records from a table which has got a column value which starts with any of the value in my inmemory list? I am trying something like below select * from table where title like 'AA%' or 'BB%' or 'CC%' Thanks
Mukil Deepthi
1

votes
1

answer
322

views

c# Quartz how to toggle schedule a job which is designed to run hourly and daily

I am new to Quartz.Net. I have a job which is scheduled to run hourly and daily. Please find below my schedule service details. Now i want to toggle the schedule so that i can enable or disable the hourly or daily schedule. public class SchedulerService : ISchedulerService { private readonly ISche...
Mukil Deepthi
1

votes
1

answer
29

views

C# Regular Expression pattern is not working

Here is my pattern. It doesn't seems to be working. I am basically looking the colorcode to be 2 to 3 alphanumeric. but this doesn't seems to be working. ^(?\d{6})\s(?\w+).*?(\s)?((?[A-Z0-9]{3})|(?\(view\d+\))*)(?:_[A-Z])?$ With the result: 123456 STLI Ocean EHC_Q colorcode: EHC is valid 123456 STL...
Mukil Deepthi
1

votes
1

answer
331

views

C# WebApi getting The parameters dictionary contains a null entry error

Have the following api method: [HttpPut] [Route('Customers/{CustomerId}/Search', Name = 'CustomerSearch')] [ResponseType(typeof(SearchResults))] public async Task Search([FromBody]SearchFilters filters, long? CustomerId = null) { //This func searches for some subentity inside customers } when I try...
Mukil Deepthi
1

votes
1

answer
746

views

Azure appservice how to connect to SQL Server in the VM

I have api appservice in my azure and also I have VM with SQL Server installed. Now I would like to connect to the database on the vm. I keep getting the following connection error when provide the connection string to api as : Server=db-svr;Initial Catalog=DBName;Persist Security Info=False;User ID...
Mukil Deepthi
1

votes
1

answer
254

views

angular2 progress bar to show progressing with linear gradient color

I am not experienced with designing UI. I am looking for a progress bar to show the progressing of http call. I want to implement as shown in the attachment. Can anyone help me with some example code to achieve this please? I am using Primeng for designing the controls. Thanks
Mukil Deepthi
1

votes
1

answer
82

views

c# csvhelper writing complex data

I have the following object structure and trying to write to csv using csvhelper. but the filenames column in not getting added. public class ClusterData { public IEnumerable FileName { get; set; } public int? ClusterNumber { get; set; } public string TopTerm { get; set; } } using (var writer = new...
Mukil Deepthi
1

votes
1

answer
55

views

how to deploy angular 6 app to azure node.js empty webapp

I used to deploy my angular app to azure web app. and want to try with nodejs webapp. Can anyone help me what are the step to do this? Is this same as the other webapp where i copy the files from dist folder and place it in the d:\home\wwwroot\sites\ Right now when i dump the contents into the \site...
Mukil Deepthi
1

votes
3

answer
623

views

Get JSON value for IEnumerable<IEnumerable<string>> type

How to get the JSON output only value in C#. I am trying to use it for type IEnumerable I have class with a property of type IEnumerable and CustomType is defined as public class CustomType{ public string Type {get;set;} public string Value {get;set;} } var data = JsonConvert.SerializeObject(collect...
Mukil Deepthi
1

votes
1

answer
174

views

C# Automapper how to apply some logic to a member

I am using Automapper to map by data object to domain object. For one of the member, i want to use some parser to the source data and map the extracted data to destination. How can i use some custom logic in Automapper? Mapper.CreateMap() .ForMember(dest=>dest.Title, options=>); Thanks
Mukil Deepthi
1

votes
1

answer
553

views

C# CSVWriter how to avoid getting empty line at the end of writing all lines to a file

I am using CSVWriter to write to csv by using the following link: How to create csv with header and footer using LinqtoCsv or anything better in C# But for some reason i am getting an empty line created at the end. Can anyone help me what am i doing wrong or how can i avoid getting an empty line? He...
Mukil Deepthi
1

votes
2

answer
12

views

C# VisualStudio 2015 how to use code from existing solution in to the new solution

I am creating a new project in c# visual studio 2015. I want to use some codes from couple of existing solutions. How to approach this situation in a best way? I have never worked on multiple solutions in VS2015 before. Appreciate some inputs. I am trying to follow the below link: https://blogs.msdn...
Mukil Deepthi
1

votes
1

answer
1.2k

views

C# Entityframework how to handle exception if error while opening DbContext

This could be a silly question. But I am new to EF. I am using EF and I would like to retry connecting to database in case there is error while opening the connection.How to handle exception while trying to open connection using DbContext. using (var db = myDbFactory.GetContext()) { // implementatio...
Mukil Deepthi
1

votes
1

answer
1.5k

views

How to override hover background color of button in Primeng

I am using Primeng in my angular2 application. I need a simple button and want to change the background color on hover of the button. Can anyone help how to achieve this? Please find below my code: .reasonButton{ background-color:#ececec; color:#000; }
Mukil Deepthi
1

votes
2

answer
34

views

how to simply style in scss so that multiple elements will use same style

I am new to sass. Here is my code in scss. Just wondering if this can be simplified further i.e i dont want to repeat the style color, text-decoration and transition. a { color: inherit; text-decoration: none; transition: all 0.3s; } div.menu-item-click { &:hover, &:focus { color: inherit; text-dec...
Mukil Deepthi
0

votes
0

answer
3

views

Angular material side nav mode not working

I have the angular 6 application which has got a main sidenav container. in one of the page i am using a simple sidenav. evertything is working but the sidenav mode is not working as expected. Though i set the mode to 'side' it is using 'over' as the default. I am using the below setting in .ts file...
Mukil Deepthi
1

votes
1

answer
76

views

What is the best flow for Angular2 application and asp.net core 2.0 api

I am having a asp.net core 2.0 webapi and pure angular2 application. I am using Identityserver4 for implementing OpenId and OAuth2 for securing the webapi. Can anyone suggest what is the best flow to implement the angular2 client application? Thanks
Mukil Deepthi
1

votes
1

answer
918

views

Linq filter array which contains multiple types which are inherited from a base type

I have a base class named A and two subclasses B and C: class B : A { public string Description { get; set; } } class C : A { public string AnotherProperty { get; set; } } I am getting an array from a method which returns array of B and C, and I want to ignore the items in the collection if the B.D...
Mukil Deepthi
2

votes
1

answer
383

views

How to get default value from web.config in webapi attribute routing parameter

Is it possible to get the attribute routing default parameter value from web.config? public class BooksController : ApiController { [Route('api/books/locale/{lcid:int?}')] public IEnumerable GetBooksByLocale(int lcid = ) { ... } } Thanks
Mukil Deepthi
5

votes
3

answer
807

views

Azure Container Name RegEx

How to validate Azure Container name using regex? I found the following line of code from some other post, but it is not validating the consecutive dashes (-). if (!Regex.IsMatch(containerName, @'^[a-z0-9](([a-z0-9\-[^\-])){1,61}[a-z0-9]$')) throw new Exception('Invalid container name); E.g. the fol...
Mukil Deepthi
17

votes
1

answer
6.9k

views

How to integrate NLog to write log to Azure Streaming log

Currently I am using NLog to write my application errors to a text file. How can I configure NLog to write the error messages to Azure Streaming Log apart from writing to a Azure Blob Storage? Thanks
Mukil Deepthi
0

votes
1

answer
55

views

C# error casting an object to a generic interface

I have the following code. I am unable to cast the object of ISearchProvider to another interface which the class has implemented. public interface IGenericSearchProcessor where T: ISearchCriteria { Task Search(T criteria); } public class GibsonSearchProvider : IGenericSearchProcessor, IAggregateSea...
Mukil Deepthi
5

votes
2

answer
4.9k

views

How to synchronously call async method from quartz schedule job

I am trying to call a webapi method from my quartz.net schedule job. I am not sure whether the way I am doing is right? Can anyone help if this is the right way or is there any better approach available? MethodRepository.cs public async Task GetResult(string queryCriteria) { return await _httpClient...
Mukil Deepthi
5

votes
2

answer
1.1k

views

Entityframework Core 2.0 error when related object is null in .Include

I am using EF core 2.0 and .Net core2.0 to develop my webapi application. In the following query, i am getting exception when the case doesnt have a workflow ie nullable workflow. the error i get is 'System.NullReferenceException: Object reference not set to an instance of an object.' I doubt the ex...
Mukil Deepthi
2

votes
1

answer
249

views

Entifyframework core 2.0 filter in ThenInclude

I am using EF core 2.0 and would like to filter the child collection. Can anyone help me how to do this in EF core 2.0? var items = await _context.RiskType .Include(r => r.Categories) .ThenInclude(category => category.Alerts) .ToListAsync(); In the above code i want to filter category.Alerts.where(a...
Mukil Deepthi
21

votes
2

answer
16.2k

views

How to make azure webjob run continuously and call the public static function without automatic trigger

I am developing a azure webjob which should run continuously. I have a public static function. I want this function to be automatically triggered without any queue. Right now i am using while(true) to run continuously. Is there any other way to do this? Please find below my code static void Main()...
Mukil Deepthi
2

votes
2

answer
1.6k

views

service bus Trigger azure webjob

I have created a azure webjob which will send a strongly typed message to a service bus queue and it successfully sends. I want to create another webjob which should be triggered whenever there is a message in the servicebus queue. Please find below the code i am trying. For some reason, though ther...
Mukil Deepthi
2

votes
2

answer
2.6k

views

Swagger UI displaying the asp.net webapi parameter name with dot notation

I have configured Swagger for my asp.net webapi which is similar to one shown below [HttpGet] [Route('search')] public async Task Get([FromUri]SearchCriteria searchCriteria) When i see the swagger documentation for the webapi , the parameter is displaying as searchCriteria.sortField searchCriteria....
Mukil Deepthi
2

votes
3

answer
1.1k

views

C# ASP.NET WebApi route template not working with uri parameters

I have an ASP.NET WebAPI application with the following controller and route: WebApiConfig.cs var constraintResolver = new DefaultInlineConstraintResolver(); constraintResolver.ConstraintMap.Add('validDate', typeof(DateConstraint)); Controller.cs [HttpGet] [Route('deleted/{from:validDate?}/{to:valid...
Mukil Deepthi
3

votes
3

answer
1.4k

views

C# VisualStudio project rebuild giving /platform:anycpu32bitpreferred can only be used with /t:exe, /t:winexe and /t:appcontainerexe

I have a windows application and using cheetah for config transformations i.e app.config.debug, app.config.test, etc., When the project is built in debug mode , it works fine but when teamcity change the mode to test configuration and try to rebuild getting the following error: /platform:anycpu32bit...
Mukil Deepthi
1

votes
2

answer
40

views

C# Linq how to use group by to get the desired output

I have the following classes public class Product { public string PNo {get;set;} public String GCode {get;set;} public IList Details {get;set;} } public class Detail{ public string Color {get;set;} public string Size {get;set;} } And i have the data in an array as below PNO GCode Color Size...
Mukil Deepthi

View additional