Thursday 30 June 2016

Top 50 AngularJS Interview Questions And Answers

Please go with this URL

Question 1: What is AngularJS?
Question 2: Explain Directives in AngularJS?
Question 3: What are expressions in AngularJS? 

http://www.c-sharpcorner.com/article/top-50-angularjs-interview-questions-and-answers/
 

Tuesday 28 June 2016

find duplicate record from list in C#

var empIds = empList.Select(x => x.EmployeeId).ToList();

var anyDuplicate = empIds.GroupBy(x => x).Any(grp => grp.Count() > 1);


It return bool value (anyDuplicate==true) if any record will be duplicate.

Friday 24 June 2016

create folder and file if missing in C#

 private static void CreateLogFileIfNotExist(string fullPath)
        {
            try
            {
                FileInfo fileInfo = new FileInfo(fullPath);
                if (!fileInfo.Directory.Exists)

                {
                    fileInfo.Directory.Create();
                }
                if (!File.Exists(fullPath))
                {
                    File.Create(fullPath).Dispose();
                }
            }
            catch (IOException ioex)
            {
                Console.WriteLine(ioex.Message);
            }

        }

Wednesday 8 June 2016

allow number only in angularjs

<input type="number" min="1" ng-pattern="/^[0-9]{1,7}$/" ng-disabled="Availability.NoRestriction" ng-model="engagementTimeslot.NumberPositions" class="form-control" />