Tuesday, October 13, 2020

Vidieo


 

Tuesday, March 27, 2018

Angular JS

1.What is Directive?

Directives are instructions which tell angular to do something.

[RouterLink]=""

Angular components are a subset of directives.

Monday, March 26, 2018

Cloud

Cloud computing means storing and accessing data and programs over the Internet instead of your computer's hard drive.

Wednesday, January 27, 2016

Agile

1.types of agile meetings?
Sprint planning meeting.
Daily scrum meetings
Sprint review meetings
Sprint Retrospective meeting
Backlog refinement meeting

2.What is velocity?
3.What is safe?
4.What is retrospective?
5.How you will do the estimation in Agile?


Friday, June 19, 2015

LINQ & Entity Frame work

1.Concatenating the first name and last name?

Just add another property in your View and concatenate FirstName and LastName as a read only property , Somthing like this :
public string FullName 
{
    get { return FirstName + " " +LastName ;}
}

return (from c in db.Doctors select new Doctor { FullName = c.FirstName + " " + c.LastName, DoctorId = c.DoctorId }) .ToList<Doctor>(); // or just .ToList();

public class DisplayDoctor { public string FullName { get; set; } public int DoctorId { get; set; } } return (from c in db.Doctors select new DisplayDoctor { FullName = c.FirstName + " " + c.LastName, DoctorId = c.DoctorId }) .ToList<DisplayDoctor>(); // or just .ToList();

2,Left outer join in LINQ?

//left join


var result = from c in db.Customers

join o in db.Orders on c.CustomerId equals o.CustomerId into gj

from sub in gj.DefaultIfEmpty()

select new { Quantity = c.CustomerName, pet=(sub==null ? 0: sub.OrderId) };





ruleSets = (from rs in db.RuleSets
join brs in db.BatchRuleSets on rs.ID equals brs.RuleSetID into j1 
from jbrs in j1.DefaultIfEmpty() 
join b in db.Batches on jbrs.BatchID equals b.id into j2 from jb in j2.DefaultIfEmpty() where !clientId.HasValue || jb.ClientID == clientId.Value where !batchId.HasValue || jbrs.BatchID == batchId.Value select new { rs.ID, rs.Description, rs.IsActive, rs.CreatedDate, rs.EffectiveDate, rs.ExpirationDate, BatchName = jb.FileName, jb.ClientID }).ToList().Select(x => new { x.ID, x.Description, x.IsActive, x.CreatedDate, x.EffectiveDate, x.ExpirationDate, x.BatchName, ClientName = GetClientName(x.ClientID)});

3.Inner Join?


//inner join

//var result = from c in db.Customers


// join o in db.Orders on c.CustomerId equals o.CustomerId


// select new { Quantity = c.CustomerName, order1=o.OrderId };





 class Program { static AccountContextDataContext aContext = new AccountContextDataContext(@"Data Source=;Initial Catalog=;Integrated Security=True"); static LoanContextDataContext lContext = new LoanContextDataContext(@"Data Source=;Initial Catalog=;Integrated Security=True"); static void Main() { var query = from a in aContext.ACCOUNTs join app in aContext.APPLICATIONs on a.GUID_ACCOUNT_ID equals app.GUID_ACCOUNT where app.GUID_APPLICATION.ToString() == "24551D72-D4C2-428B-84BA-5837A25D8CF6" select GetLoans(app.GUID_APPLICATION); IEnumerable<LOAN> loan = query.First(); foreach (LOAN enumerable in loan) { Console.WriteLine(enumerable.GUID_LOAN); } Console.ReadLine(); } private static IEnumerable<LOAN> GetLoans(Guid applicationGuid) { return (from l in lContext.LOANs where l.GUID_APPLICATION == applicationGuid select l).AsQueryable(); } }


4. Lazy loading in Entity framework?
Lazy loading means delaying the loading of related data until you specifically request it. For example, Student class contains StudentAddress as complex property. So context first loads all the students from the database then it will load address of particular student when we access StudentAddress property as below.
Rules for lazy loading:

  1. context.Configuration.ProxyCreationEnabled should be true.

  1. context.Configuration.LazyLoadingEnabled should be true.

  1. Complex property should be defined as virtual. Context will not do lazy loading if the property is not define as virtual.
http://www.codeproject.com/Articles/652556/Can-you-explain-Lazy-Loading

Remove the Order from consturctor.

public List
    customer cust=new customer()
    foreach(Order o1 in orders)
    {
    console.writeline(o1.ordernumber);//lazy loading calls now
    }


    5.Calling stored procedure in Entity framework?

    Right-click Stored Procedure and select "Add Function Import".
    return item is complex type

    using (Entities context = new Entities())
    {
    IEnumerable<EmployeeDetails> empDetails = context.GetEmployeeData();
    }

    2nd option suing exec

    // using DBContext (EF 4.1 and above)using (Entities context = new Entities())
    {
    IEnumerable<EmployeeDetails> empDetails = context. Database.SqlQuery
    < EmployeeDetails >("exec GetEmployeeData ", null).ToList();
    }
    3rd option
3. Call Stored Procedure using DbDataReader

We can also retrieve data or call a Stored Procedure using a SQL Connection Command and DbDataReader. The Object Context has a translate method that translates the entity data from DbDataReader into the requested type object. This method enables us to execute a standard ADO.Net query against a data source and return data rows into entity objects. Using the following code we can call a Stored Procedure and retrieve data in entity form.
using (Entities context = new Entities())
{
string ConnectionString = (context.Connection as EntityConnection).StoreConnection.ConnectionString;
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(ConnectionString);
builder.ConnectTimeout = 2500;
SqlConnection con = new SqlConnection(builder.ConnectionString);
System.Data.Common.DbDataReader sqlReader;
con.Open();
using (SqlCommand cmd = con.CreateCommand())
{
cmd.CommandText = "GetEmployeeData";
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.CommandTimeout = 0;
sqlReader = (System.Data.Common.DbDataReader)cmd.ExecuteReader();
IEnumerable<EmployeeDetail> empDetails = context.Translate<EmployeeDetail>(sqlReader).ToList();
}
}

Stored procedure in EF?

http://www.entityframeworktutorial.net/stored-procedure-in-entity-framework.aspx

6.Multiple Databases in Entity framework?

7.Entity framework advantages ?
Maintain the versioning.

8. How to enable migration EF?
Enable-Migrations -ContextTypeName AdvantureworksContext
pm>Add-Migration Initial -ignorechanges
pm>update-database

9. EDM file consist of?

SSDL Content,CSDL and C -S mapping content
i.storage model
ii.Conceptual Model
iii.Mappings

a.Entity Container
b.Entity Set
c.Entity Type
d.Association Set
e.Object context

10.Eagar loading?
Eager loading is achieved using the Include method of IQueryable.


 using (var context = new SchoolDBEntities())
        {
            var res = (from s in context.Students.Include("Standard")
                        where s.StudentName == "Student1"
                        select s).FirstOrDefault();
        }
Student table and Standard table

11.What is entity framework?
Writing and managing ADO.Net code for data access is a tedious and monotonous job. Microsoft has provided an O/RM framework called "Entity Framework" to automate database related activities for your application.
 

Entity framework is an Object/Relational Mapping (O/RM) framework. It is an enhancement to ADO.NET that gives developers an automated mechanism for accessing & storing the data in the database.

Thursday, March 12, 2015

Scnario based questions

1. 10 resources keep on logging and checking any file is came into system then he can download and update the system. We need to automate and provide architecture.

batch program and scheduled

2.password encrypt using SHA1, MD5 using round rabin.
design the object, send the server , password and sha1.

3.One employee resign how to intimate the payroll?