Friday, 7 April 2023

Automapper Reverse Mapping: Mapping Objects in Both Directions

AutoMapper is a popular object mapping tool used in .NET applications. It simplifies the process of mapping one object to another by automatically copying properties with matching names and types. Reverse mapping with AutoMapper allows you to create mappings in both directions, from the source object to the destination object and vice versa.

Let's take an example of a simple class Person and its corresponding PersonDto class, which we want to map to each other using AutoMapper.

public class Person

{

    public int Id { get; set; }

    public string FirstName { get; set; }

    public string LastName { get; set; }

    public int Age { get; set; }

}


public class PersonDto

{

    public int Id { get; set; }

    public string FullName { get; set; }

    public int Age { get; set; }

}

Now let's create a mapping from Person to PersonDto:

var config = new MapperConfiguration(cfg =>

{

    cfg.CreateMap<Person, PersonDto>()

        .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => src.FirstName + " " + src.LastName))

        .ReverseMap()

        .ForMember(dest => dest.FirstName, opt => opt.MapFrom(src => src.FullName.Split(' ')[0]))

        .ForMember(dest => dest.LastName, opt => opt.MapFrom(src => src.FullName.Split(' ')[1]));

});


IMapper mapper = config.CreateMapper();


var person = new Person { Id = 1, FirstName = "John", LastName = "Doe", Age = 30 };

var personDto = mapper.Map<PersonDto>(person);


var personDto2 = new PersonDto { Id = 2, FullName = "Jane Smith", Age = 25 };

var person2 = mapper.Map<Person>(personDto2);


In the above code, we first create a mapping from Person to PersonDto and then use the .ReverseMap() method to create a reverse mapping from PersonDto to Person without having to define it explicitly.

With the .ReverseMap() method, we can then use the mapper.Map method to map Person and PersonDto instances in both directions, as shown in the example above.

Thursday, 6 April 2023

Strategies for Wealth Creation

 Wealth creation is a topic that is of great interest to many people, and for good reason. It is the process of building financial assets and achieving financial independence. Wealth creation involves a combination of earning income, saving, investing, and managing money effectively. In this blog post, we will explore some strategies for wealth creation that can help you achieve your financial goals.

Set financial goals

The first step in creating wealth is to set clear financial goals. This involves defining your long-term and short-term financial objectives. Setting financial goals can help you create a roadmap for achieving financial independence. To set effective financial goals, make sure they are specific, measurable, achievable, relevant, and time-bound.

Increase your income

Increasing your income is an important step in wealth creation. This can be achieved by asking for a raise at work, starting a side business, or acquiring new skills that can lead to a higher-paying job. The more income you earn, the more money you can save and invest.

Save and invest

Saving and investing are critical components of wealth creation. To save effectively, you must develop and stick to a budget. This involves tracking your expenses and finding ways to reduce unnecessary spending. Once you have saved some money, you can start investing it. Investing can help you grow your wealth over time. Some investment options include stocks, bonds, mutual funds, real estate, and exchange-traded funds (ETFs).

Manage debt

Managing debt is another important aspect of wealth creation. Debt can be a significant obstacle to building wealth, so it is essential to keep it under control. Make sure you pay off high-interest debt first, such as credit card debt. Consider consolidating your debt with a low-interest personal loan or a balance transfer credit card.

Create multiple streams of income

Creating multiple streams of income can help you accelerate your wealth creation journey. This can involve starting a side business, investing in rental properties, or earning passive income through investments. The more income streams you have, the more money you can earn and save.

Seek professional advice

Seeking professional advice can help you make informed financial decisions. Consider working with a financial advisor who can help you create a personalized wealth creation plan. A financial advisor can also help you identify potential risks and make adjustments to your plan as needed.

In conclusion, wealth creation is a process that requires a combination of earning income, saving, investing, and managing money effectively. By setting clear financial goals, increasing your income, saving and investing, managing debt, creating multiple streams of income, and seeking professional advice, you can build wealth over time and achieve financial independence. Remember that wealth creation is a journey, so be patient and stay focused on your goals.

Tuesday, 4 April 2023

Top Restaurants in Lahore for Food Lovers

 Lahore is a city of vibrant culture, architecture, and cuisine. The city offers a range of culinary experiences, from traditional street food to fine dining. In this article, we have put together a list of the best restaurants in Lahore that will tantalize your taste buds and leave you wanting more.

Andaaz Restaurant

Located in the heart of Lahore, Andaaz Restaurant is a hidden gem that offers authentic Pakistani cuisine. The restaurant has a traditional ambiance, and the service is exceptional. Their Chicken Handi and Mutton Karahi are a must-try. They also have a variety of vegetarian dishes on their menu.

Website: https://andaazrestaurant.com/

Butt Karahi

Butt Karahi is a well-known restaurant in Lahore that is famous for its Karahi. Located in the old city, Butt Karahi is a must-visit restaurant for all food lovers. Their Karahi is cooked to perfection and is rich in flavor. The restaurant has a cozy and traditional ambiance that will make you feel right at home.

Website: http://buttkarahi.com.pk/

Salt n Pepper

Salt n Pepper is a well-known restaurant chain in Pakistan. Their Lahore branch is located in Gulberg, and it offers a fine dining experience. The menu at Salt n Pepper is a fusion of Pakistani and Continental cuisine. Their Grilled Chicken and Steaks are a must-try. The restaurant has a sophisticated ambiance, and the service is excellent.

Website: http://saltnpepper.com.pk/

Monal Restaurant

Monal Restaurant is a famous fine dining restaurant in Lahore located on the outskirts of the city. The restaurant offers a beautiful view of the city and serves a variety of Pakistani and Continental cuisine. Their Lahori Fish, Mutton Chops, and Chicken Handi are highly recommended. The restaurant has a luxurious ambiance, and the service is impeccable.

Website: https://lahore.themonal.com/

Conclusion

Lahore's culinary scene offers a diverse range of flavors that will leave you craving for more. The restaurants we have mentioned in this article are some of the best in Lahore and offer an authentic culinary experience. From traditional Pakistani cuisine to fusion dishes, these restaurants cater to a wide range of tastes. So, the next time you're in Lahore, be sure to visit these restaurants and savor the delicious food that they have to offer.

I hope this article helps you in writing your blog post. Let me know if you need any further assistance.

Format C# code in Visual Studio

                        There are a few ways to format C# code in Visual Studio:

Keyboard shortcut: You can use the keyboard shortcut "Ctrl + K, Ctrl + D" to format the entire document or the currently selected code in Visual Studio.

Context menu: You can also right-click on the code editor and select "Format Document" or "Format Selection" from the context menu.

Menu bar: You can navigate to the "Edit" menu, select "Advanced", and then choose "Format Document" or "Format Selection".

Code cleanup: You can use the "Code Cleanup" feature in Visual Studio, which not only formats your code but also applies other code style preferences you have set. To access it, go to "Tools" > "Code Cleanup" and choose the desired code style configuration.

Extensions: There are several extensions available in the Visual Studio Marketplace that can help you format your code. One popular extension is "CodeMaid", which provides many code cleanup and formatting options.


Regardless of the method you choose, it's important to ensure that your code is consistently formatted and adheres to a defined coding style to make it more readable and maintainable. 

Please note that these options may not be available in all versions of Visual Studio or with all configurations. If neither of these options work for you, you may need to use an extension or modify your Visual Studio settings.

Wednesday, 10 August 2022

 Job:
I need an expert and experienced web designer to help me with my website. We would be creating our own template, and covering every aspect of the website, home page, log in, personal questions, menu, food etc... This is a nutrition website so design is very important for this big business in order to reach the maximum number of users.

Wednesday, 22 December 2021

Software houses in lahore Pakistan

Systems Limited
 
Contour Software
 
Allzone Technologies
 
NETSOL Technologies
 
Northbay Solutions
 
 Xavor 
 
Afiniti
 
Confiz
 
Nextbridge
 
i2cinc
 
DatumSquare IT Services
 
10pearls
 
PureLogics
 
BrainX Technologies

InvoZone

SigmaTec
http://www.sigmatec.com.pk/careers

Wadic
 










Best .Net websites and tutorial links for beginners and professionals.

Videos Links:

kudvenkat:

https://www.youtube.com/c/Csharp-video-tutorialsBlogspot/playlists

 IAmTimCorey:

https://www.youtube.com/user/IAmTimCorey/playlists 

Questpond:
https://www.youtube.com/c/questpondvideos/playlists
 
freeCodeCamp.org:
https://www.youtube.com/c/Freecodecamp/playlists 
 
Programming with Mosh:
https://www.youtube.com/c/programmingwithmosh/playlists 
 
 Les Jackson:
 https://www.youtube.com/c/binarythistle/playlists
 
 
Websites Links
  1. https://csharp-video-tutorials.blogspot.com/p/free-aspnet-video-tutorial.html

  2. https://dotnettutorials.net/

  3. https://dotnet.microsoft.com/en-us/learn 

  4. https://www.javatpoint.com/net-framework

  5. https://www.tutorialsteacher.com/core

  6. https://www.dotnettricks.com/learn/aspnet

  7. https://www.c-sharpcorner.com/csharp-tutorials

  8. https://www.guru99.com/asp-net-tutorial.html

  9. https://www.tutorialspoint.com/asp.net/index.htm 

     

    If you know any best .Net websites or tutorials links which is not mentioned in the above list then please post in comments. We will definitely add in our list.